Page 1 of 1

Python exercise: please provide me with the codes. 2-4. Name Cases: Store a person’s name in a variable, and then print

Posted: Thu May 26, 2022 9:17 am
by answerhappygod
Python exercise: please provide me with the codes.
2-4. Name Cases: Store a person’s name in a variable, and then print that per- son’s name in lowercase, uppercase, and titlecase .
2-5. Famous Quote: Find a quote from a famous person you admire . Print the quote and the name of its author . Your output should look something like the following, including the quotation marks:
Albert Einstein once said, “A person who never made a mistake never tried anything new.”
2-6. Famous Quote 2: Repeat Exercise 2-5, but this time store the famous per- son’s name in a variable called famous_person . Then compose your message and store it in a new variable called message . Print your message .
2-7. Stripping Names: Store a person’s name, and include some whitespace characters at the beginning and end of the name . Make sure you use each character combination, "\t" and "\n", at least once .
Print the name once, so the whitespace around the name is displayed . Then print the name using each of the three stripping functions, lstrip(),rstrip(), and strip() .