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

1 answer

Here's a simple Python program that achieves the desired functionality. You can copy and paste this code into PythonAnywhere or any other Python environment you wish to use.

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

# Converting the name to uppercase and lowercase
uppercase_name = name.upper()
lowercase_name = name.lower()

# Printing the results
print(f"Your name in all uppercase letters is: {uppercase_name}")
print(f"Your name in all lowercase letters is: {lowercase_name}")

Instructions to Run on PythonAnywhere

  1. Go to PythonAnywhere.
  2. Sign in or create an account if you don't have one.
  3. Start a new console or a new file.
  4. Copy the code above into the console or file.
  5. Run the code to see the output.

After you run your code successfully, you can share the link to your PythonAnywhere file or console as required. If you have any further questions or need assistance, feel free to ask!