Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Country Game
- # Written by ***
- # Date Written 20/9/19
- # Language: Python v3.7
- print("Country-Capital Game") # // Dislays name of program, returns string value ""
- print("=" * 50)
- countryAreas = [["Australia", "Canberra"], ["Greece", "Athens"], ["China", "Beijing"], ["France", "Paris"], ["Germany", "Berlin"]] # // 2 Dimension list
- while True: # // Continuation loop to start program over again
- x = 0
- while x < len(countryAreas):
- print("\nEnter the capital of", countryAreas[x][0] + ":", end=" ")
- countryCapital = input()
- if countryCapital.upper() == (countryAreas[x][1]).upper():
- print("\nCongratulations! That is the Correct Answer!")
- x += 1 # // Only advance to next country if we guess correctly
- else:
- print("\nSorry, that is an incorrect answer, please try again!")
- x != 1 # // Stay on same country if we get answer incorrect, don't pass
- cont = input("\nWould you like to continue Y/N: ")
- if cont.upper() == "N":
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement