Record#
- Continue learning while loops. Today I learned the combination of True and break, which can reduce one variable and some code, making the logic clearer.
- The T in True must be capitalized, and the break statement should be inside the while loop.
- I am very satisfied with the small game I wrote, hahaha, quite interesting.
CODE#
print("Are you really from the North? ")
print("Let's determine if you are really from the North through 3 tests. ")
while True:
n1 = int(input("How much does a cup of Gongting Yuye wine cost? "))
n2 = int(input("How much for a big hammer? "))
n3 = int(input("How much for a small hammer? "))
if n1 != 180 and n2 != 80 and n3 != 40:
print("You are a fake northerner!")
break
else:
print("You are really from the North")
break