InfoTc’1040’Introduction’to’Problem’Solving’and’Programming ’ String’Report ’ 1 In this programming assignment you are going to use the material covered in Chapter 8 More About Strings to write a program called stringreport.py that creates a report about a string entered by the user at a prompt. Requirements’ Request a string from the user using the prompt "Enter a string: " and do the following: • Determine the length of the entered string and do one of the following: o If it is zero characters in length output the message "You did not enter anything!" and exit the program. o If the entered string is one or more characters in length display the following information about the string and exit the program. § The length of the string. That is, the number of characters it contains. § The first character of the string. § The last character of the string. § Indicate if the string contains the word "open". § Indicate if the string contains only alphabetic letters and spaces. § Indicate if it contains only numeric digits. § Indicate if the entire string is lower case. § Indicate if the entire string is upper case. Note:
For’the’items’above’that’say’"Indicate’if. ..",’the’ output’is’to’present’a’"yes"’or’"no". ’ The information is to be formatted in reports that look like the ones presented in the following examples. The labels shown are to be used in your program. Enter a string: please open my email Length: 20 First character: p Last character: l Contains open: yes Only alphabetic letters and spaces: yes Only numeric digits: no All lower case: yes All upper case: no Enter a string: You did not enter anything!
Description:
This Python program (stringreport.py
) prompts the user to enter a string and generates a detailed report of its properties. The program checks if the string is empty, displays its length, first and last characters, and reports on several characteristics such as whether it contains the word "open", contains only alphabetic letters and spaces, consists only of digits, or is entirely lower or upper case. All results are displayed using clear labels and "yes"/"no" answers, matching the required output format.