0

[Solved] Why does the second input result in TypeError?

https://code.sololearn.com/c9PwdwUdEz9d/?ref=app

26th Nov 2020, 4:19 AM
Adam Stork
Adam Stork - avatar
2 ответов
+ 4
# Password quantity input. def inp_pas(): global inp_pas inp_pas = int(input('Input: ')) You have both a function and a global variable by the same name. global inp_pas redefines def inp_pas from a function type to an int type.
26th Nov 2020, 4:33 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
ChaoticDawg Such a rookie mistake! Thank you!
26th Nov 2020, 4:55 AM
Adam Stork
Adam Stork - avatar