Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- b = -1
- picked = []
- countries=["Argentina", "Bolivia", "Brazil", "Chile", "Colombia", "Ecuador", "Guyana", "Paraguay", "Peru", "Surinam", "Uruguay", "Venezuela"]
- capitals=["Buenos Aires", "Sucre", "Brasilia", "Santiago", "Bogota", "Quito", "Georgetown", "Asuncion", "Lima", "Paramaribo", "Montevideo", "Caracas"]
- print("Let's play Guess the Capital!")
- def getNumber():
- b = random.randrange(0,11)
- def main():
- getNumber()
- while True:
- if b in picked:
- getNumber()
- else:
- break
- picked.append(b)
- print(countries[b])
- guess = input("Name the Capital:")
- if guess is capitals[b]:
- print("Correct!")
- else:
- print("Sorry, the answer was {0}.".format(capitals[b])
- while True:
- main()
- if input("Done?") is "yes":
- break
- elif len(b) >= 11:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement