Код: Выделить всё
if [selection]:
[code]
if [selection]:
[code]
else:
[code}
else:
[code]
Код: Выделить всё
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!
Код: Выделить всё
name = input("Give name:")
password = input("Give password:")
if name == "John":
if password == "ABC123":
print("Both inputs are correct!")
else:
print("The given password is incorrect.")
else:
print("The given name is wrong.")
Он должен мне это сообщить. сразу, что имя неправильное, и если имя правильное, то переходим к запросу пароля.
Подробнее здесь: https://stackoverflow.com/questions/709 ... ssword-and