Sep-14-2020, 01:06 AM
Hello, I'm using PythonAnywhere.com. I don't understand how to format these if/else statements so when the user doesn't enter their name, the result will ONLY be "Please enter your name." Instead it adds "Hi You are a student".
first_name = input("What is your name? ") if first_name == "": print("Please enter your name: ") if first_name.lower() == "steve": print("You are the instructor") else: print("Hi " + first_name + "you are a student")
Output:What is your name?
Please enter your name:
Hi You are a student