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. Write it in PythonAnywhere and submit the link to your code in the answer space below. 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(2 points)

1 answer

Here's a simple Python program that achieves what you've described. You can run this code in PythonAnywhere or any Python environment:

# Ask the user for their name
name = input("What is your name? ")

# Print the name in all uppercase
print("Your name in all uppercase letters is:", name.upper())

# Print the name in all lowercase
print("Your name in all lowercase letters is:", name.lower())

To use this code, simply copy and paste it into your PythonAnywhere console or a Python file and run it.

This program works by taking the user's input, then utilizing the upper() method to convert it to uppercase and the lower() method to convert it to lowercase. The output format matches the requirements you've specified.

To submit your code, you'll need to run this in PythonAnywhere, then share the link to your specific code file or console output.