Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program to analyze a sentence provided by the user. Here are the criteria: Your program L6Qlinitials.py must start with a commented academic
Write a program to analyze a sentence provided by the user. Here are the criteria: Your program "L6Qlinitials.py" must start with a commented academic integrity pledge, ID Box, and program purpose. EACH of the four functions in your p including the main function must state its purpose in comments too. As strings are the focus of this question, lists and list methods are will be penalized heavily if used. The main function in your program must be named: examin provided for you. Copy this function into your program def examine_string(): get_string() string explore_chars (string) count_uppercase (string) count Distrution of this string): and string. It has been as written: As you can see, examine_string get_string(): s Studes THREE helper functions namely: Prompt the user for a string of 8 or more characters ending with a question mark. Error the string to ensure it meets the criteria. Return the string. Academic Integrity Poliram pe propert explore_chars Determine and output the (a) string length, (b) third char, (c) third last char and er or not it is lowercase, (d) original string, and (e) the string after the first four chars with the last four chars. Distroution of this Count how many uppercase chars there are in the string and (f) display this amount together with the uppercase chars that were counted. The sample outputs provided next each show one example. Your output should be similar in layout but reflect whatever string is input by the user. c) >>> examine_string() Enter 8 or more chars ending with a question mark: -> 3 exams? (a) Length (b) 3rd char (c) 3rd last (d) Original (e) Swap 4 chars --> ams?3 ex (f) Uppercase amt -> 0 () (a) Length (b) 3rd char --> 8 chars ----> e >>> examine_string() Enter 8 or more chars ending with a question mark: -> TODAY? -> Incorrect try again: I wonder if it is toda -> Incorrect - try again: When is it DUE? --> m (lowercase) --> 3 exams? -----> 15 chars -----> e (c) 3rd last (d) Original (e) Swap 4 chars --> DUE? is (f) Uppercase amt -> 4. >>> examine_string() tribution of this assign fo ----> U (NOT ---> When is it Enter 8 or mor -> What? -> Incorre - try again: I don't understand. -> Inco try again: What TIME is it NOW? rity Policy ancentellectual property law. chars ending with a question mark: > 20 chars QUES When 3rd char ------> a 3rd last--> O (NOT lowercase) (d) Original -> What TIME is it NOW? (e) Swap 4 chars --> NOW? TIME is it What (f) Uppercase amt -> 8 (WTIMENOW) 2 Save the program as "L6Qlinitials.py" replacing initials with your actual initials. Submit your program electronically for marking.
Step by Step Solution
★★★★★
3.32 Rating (146 Votes )
There are 3 Steps involved in it
Step: 1
Heres a Python program that follows the specified requirements def getstring while True userinput in...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started