forked from flatplanet/Intro-To-TKinter-Youtube-Course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflash_random_loop.py
42 lines (32 loc) · 852 Bytes
/
flash_random_loop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from random import randint
import random
answer_list = []
global our_states
our_states = ['california', 'florida', 'illinois', 'kentucky', 'nebraska', 'nevada', 'newyork', 'oregon', 'texas', "vermont"]
global our_state_capitals
our_state_capitals = {
'california':"sacramento",
'florida':"tallahassee",
'illinois':"springfield",
'kentucky':"frankfort",
'nebraska':"lincoln",
'nevada':"carson city",
'newyork':"albany",
'oregon':"salem",
'texas':"austin",
'vermont':"montpelier"
}
count = 1
while count < 4:
rando = randint(0, len(our_states)-1)
if count == 1:
answer = our_states[rando]
# Add our first selection to a new list
answer_list.append(our_states[rando])
# Remove from old list
our_states.remove(our_states[rando])
#Shuffle original list
random.shuffle(our_states)
count += 1
print(answer_list)
print(answer)