Question: python OBJECTIVES i. To understand logical and relational operators ii. To test conditions to see if they are True or False iii. To use simple
OBJECTIVES i. To understand logical and relational operators ii. To test conditions to see if they are True or False iii. To use simple decision structures (if-else) in a program 1. Write a Python program (with comments) to do the following: a. Ask the user to enter their last name. The user may enter their name using either lowercase or uppercase letters, or a combination of both. Save the last name in a variable name, as a str whose I letter is capitalized, and all other letters are lowercase. Print the saved name. b. If name contains only alphabetic characters, print "Your name contains only alphabetic characters. c. Otherwise, print "Your name contains non-alphabetic character(s).' d. If name contains the strae print 'Your name contains "ae".' e. Otherwise, if name contains the str 'be' print 'Your name contains "be".' f. Otherwise print the number of characters in name, with a suitable message
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
