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? MariaYour name in all uppercase letters is: MARIAYour name in all lowercase letters is: maria(2 points)

1 answer

Here's a simple Python program that accomplishes the task you described. You can run this code in an environment like PythonAnywhere or any Python interpreter.

# 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())

Steps to run the code in PythonAnywhere:

  1. Go to PythonAnywhere.
  2. Sign up for an account or log in if you already have one.
  3. Navigate to the "Consoles" tab.
  4. Start a new Python console (choose Python 3.x).
  5. Copy and paste the code above into the console and press Enter to run it.

Example Output:

If a user inputs "Maria", the output will be:

What is your name? Maria
Your name in all uppercase letters is: MARIA
Your name in all lowercase letters is: maria

Once you run the code, you can provide the link to your PythonAnywhere code execution or script as required.