71.2k views
5 votes
Write a Python program that asks the user for their name and then prints the name out in all uppercase and then in all lowercase letters. The output should look like this:

What is your name? Maria

Your name in all uppercase letters is: MARIA

Your name in all lowercase letters is: maria

User OronNavon
by
4.8k points

2 Answers

3 votes

Answer:

print("What is your name?")

string = "Your name in Uppercase letters:MARIA"

print(string.upper())

string = "Your name in lowercase letters"

print(string.llower())

User Czarek
by
3.9k points
5 votes

Answer:

name = input("What is your name? ")

print("Your name in all uppercase letters is " + name.upper()

print("Your name in all lowercase letters is " + name.lower()

Step-by-step explanation:

The first line takes in the user input and stores it in the variable name.

The second line concatinates the string with the variable name. Then to turn the string name to upper case i used the .upper() in built python method. and did the same thing with the .lower()

User Henrycharles
by
4.5k points