This is how the exercise wants the output to be:
Give name: Peter
The given name is wrong.
Give name: John
Give password: Monkeys?
The password is incorrect.
Give name: John
Give password: ABC123
Both inputs are correct!
This is the code that I've written:
print("Give name:");
name = input();
if name == "John":
print(name);
else:
print("The given name is wrong.");
print("Give password:");
password = input();
if password != "ABC123":
print("The password is incorrect.");
else:
print("Both inputs are correct!");
But the console prints out this:
Give name:
Peter
Traceback (most recent call last):
File "ohjelma.py", line 9, in
password = input();
The given name is wrong.
Give password:
EOFError: EOF when reading a line
Aucun commentaire:
Enregistrer un commentaire