Skip to content

Commit 8de9425

Browse files
author
Mark Charlton
committed
testing gitignore
1 parent 1a9dc73 commit 8de9425

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.history/

Assessment/Wk7/thunderbirds.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
19.7 KB
Loading

0 commit comments

Comments
 (0)