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 Answers
+ 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