File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ .history /
Original file line number Diff line number Diff line change 1+ # Identify Thunderbirds.
2+
3+ #inits
4+ a_tbirds = ['List of Thunderbird Pilots' ,
5+ 'Thunderbird 1 pilot is Scott Tracy' ,
6+ 'Thunderbird 2 pilot is Virgil Tracy' ,
7+ 'Thunderbird 3 pilot is Alan Tracy' ,
8+ 'Thunderbird 4 pilot is Gordon Tracy' ]
9+ s_else = 'Have you never watched Thunderbirds!'
10+ s_error = "Invalid entry. Please ensure you've entered a number!"
11+
12+ # header
13+ print ( 'Thunderbirds Are Go' )
14+ print ( '-' * 19 )
15+
16+ # get input
17+ i_val = "A"
18+ while i_val == "A" :
19+ try :
20+ i_val = int ( input ( "Please enter a number between 1 and 4 inclusive: " ))
21+
22+ except ValueError : ## Value Error
23+ print ( "VE: " + s_error )
24+ i_val = "A"
25+ except : ## General Error
26+ print ( "GE: " + s_error )
27+ i_val = "A"
28+
29+ if i_val > 0 and i_val < 5 :
30+ print ( a_tbirds [i_val ])
31+ else :
32+ print ( s_else )
33+
You can’t perform that action at this time.
0 commit comments