Why my code doesn’t write “good job”? It only jumps after “inp_user” and “inp_pin” to “question” imput.
…and loog not working too :D
JavaScript
x
19
19
1
username = "boy"
2
pin = 123
3
inp_user = input("User: ")
4
inp_pin = int(input("Pin: "))
5
6
def loop():
7
if inp_user == username and inp_pin == pin:
8
print("Good Job")
9
else:
10
print("Bruh")
11
12
question = input("again?: ")
13
14
def second():
15
if question == "Yes":
16
loop()
17
else:
18
exit
19
Advertisement
Answer
your code won’t work because you don’t call the cunctions you have defined
Try This:
JavaScript
1
17
17
1
username = "boy"
2
pin = 123
3
4
5
while True:
6
7
inp_user = input("User: ").strip()
8
inp_pin = int(input("Pin: ").strip())
9
10
if inp_user == username and inp_pin == pin:
11
print("Good Job")
12
else:
13
print("Bruh")
14
question = input("again?: ")
15
if question.strip() != "Yes":
16
break
17