0

python 33.2

#Всем удачи) password = input() repeat = input() def validate(text1, text2): if text2 == password : print('Correct') if not text1 == text2 : print('Wrong') validate(password,repeat)

11th Sep 2021, 7:49 PM
Tedi
Tedi - avatar
2 Respostas
+ 5
you may want to replace your if statements. mainly text2==password with text2==text1. its usually not good practice to use a global variable type with a function. in a more complex code, it could cause problems. another suggestion would be replacing text1 in the arguments with password. below is an example. example 1: def validate(text1, text2): if text2 == text1: print('Correct') else: print('Wrong') validate(password,repeat) example 2: def validate(password, text2): if text2 == password: print('Correct') else: print('Wrong') validate(password,repeat)
11th Sep 2021, 10:21 PM
you are smart. you are brave.
you are smart. you are brave. - avatar
+ 6
Tedi , if you really have a problem, we need some more details from you: ▪︎give a clear and complete description about your task ▪︎if your question is related to an exercise in a tutorial, please mention the tutorial name and the lesson number ▪︎if there are error messages please post them here ▪︎give at least one sample with input data and the expected output thanks for your understanding!
11th Sep 2021, 8:10 PM
Lothar
Lothar - avatar