Question: please answer in python as soon as possible. Thank you OBJECTIVES: i. To understand logical and relational operators ii. To test conditions to see if
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 1" 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 str 'ae' 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. g. Save your code to a file with name lab5sol.py. h. Submit your Python code (i.c. lab5sol.py file) through BB. A sample session is shown below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
