Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python: Look at the code (i.e. Test data ). The input is what the user enters. The output is what I should get (but I'm

Python: Look at the code (i.e. Test data ). The input is what the user enters. The output is what I should get (but I'm having trouble). I have trouble capitalizing one letter words. When user enters string "And to all a good night" , I should get "And to All A Good Night" . I also need 'and', 'the', 'not' to be capitalized only when they're the first letter of given strings. Please follow the 3 strings given and enter exactly as input and output. Please provide the source code. Thanks. image text in transcribed

13 14 15 1 6 17 18 19 20 21 Test data: input: the quick brown dogNow is the time for al1 good men And to all a good night output: 'The Quick Brown Dog Now is the Time For All Good Men And to All A Good Night' Params: s (string) Returns: (3 strings) 23 24 25 2 6 27 28 29 30 31 32 skipList and, 'the,not sen-string.split(' ') sentance-' for word in se if word not in skipList and len (word) >2: sentance-sentance+ ''+word.title () else: ' ' sentance=sentance + +word return sentance. lstrip() s-input ("Type in any string: ") sen=word2 capitalize (s) print (sen)| 35 36 checkerboard checkerboard checkerboard uppercase test test uppercase Type in any string: the quick brown dog the Quick Brown Dog

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How do rapid growth firms deal with potential cash flow shortfalls?

Answered: 1 week ago