US Capitals Quiz
Intro
Hi everyone, I just learned python at a summer camp and this is what I created for the final project. In this game you will have to guess the capitals of US states. You can play lots of times because I use random.choice()
to give 10 randomized questions each time.
Rules
You have to guess the capital given the state. If you get it correct, your score will increase by 1.
How I made it
I used a text file for all the states and capitals of the US. But there was an extra city so I split it so it would only give the state and capital. Then I created a dictionary where the state is the key and the capital is the value.Then I created a function called game and used if and else to see if the input was the correct capital. And finally I added some colors using Ansi escape codes.
I feel like dying (your score is: 0
What is the capital of Minnesota: saint paul
Wrong! :(
St. Paul is the capital of Minnesota
Your score is: 0
What is the capital of Connecticut:
)
wait nebraska doesn't exist
@HahaYes it does https://en.wikipedia.org/wiki/Nebraska here's proof
My life is complete.
I'm actually not so bad now.
@HenryZelonka1 7 is really good!
I'm addicted to this game.
Beat that:
My life is a lie:
Finally,
(I'm not from the US)
Cool anyway
I know capitals, but not USA states capitals
I only know that USA's capital is washington
Cuz i am not from USA
@ZDev1 That's ok. Glad you liked it!
@ZDev1 I only know capital letters
@BlueComet :)
@DynamicSquid XDXDXDXDXDXDXDXDXD
@DynamicSquid then you can use this to learn and then youll know both types of capitals
@BlueComet ok