Answer the question
In order to leave comments, you need to log in
How to compare two arguments by number of characters?
I'm trying to write a simple program with a username and password.
The problem is that I don't know how to use the if argument to make it so that when entering a password of less than 8 characters, an error is generated.
username = input('Введите имя пользователя: ')
password = input('Введите пароль: ')
Answer the question
In order to leave comments, you need to log in
password = ''
while len(password) < 8:
password = input('Введите пароль: ')
if len(password) < 8:print('Неправильно, давайте еще раз')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question