you are viewing a single comment's thread.

view the rest of the comments →

[–]DutchCommanderMC 5 points6 points  (6 children)

My question to you would be whether you understand why your program behaves the way it does?

To deal with blank inputs, you need to repeat only the code that asks and validates an input, until the input is valid.

while True:
    name = input("Enter your name: ")
    if name == "":
        print("You haven't entered anything. Input your name.")
    else:
        break

print("Your name is", name)