Record#
- Continue learning while loops. Today I learned the combination of True and break, which can reduce the use of a variable and some code, and make 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, it's 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 Yuyue wine cost? "))
n2 = int(input("How much does a big hammer cost? "))
n3 = int(input("How much does a small hammer cost? "))
if n1 != 180 and n2 != 80 and n3 != 40:
print("You are a fake northerner!")
break
else:
print("You are a real northerner")
break