Advertisement
Guest User

Untitled

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