Skip to content

Commit 0d47238

Browse files
author
Mark Charlton
committed
after read through and validating requirements.
1 parent 603defe commit 0d47238

11 files changed

+13
-11
lines changed

Assessment/Wk2/address.jpg

-93.5 KB
Loading

Assessment/Wk2/address.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@
2121

2222
print ( "Address Label Creator" )
2323
print ( "-" * 22)
24-
print ( f'{str_salutation} {str_name}')
25-
print ( f'{str(int_house_number)} {str_road}')
26-
print ( f'{str_town}')
24+
print ( f'{str_salutation} {str_name},\n{str(int_house_number)}, {str_road}\n{str_town}')

Assessment/Wk3/Thumbs.db

73 KB
Binary file not shown.

Assessment/Wk3/average_test1.jpg

4.3 KB
Loading

Assessment/Wk4/magpie.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
a_line.append("Six for gold")
1111
a_line.append("Seven for a secret never to be told")
1212

13-
# get user selection
14-
usr_selection = int(input("Enter your chosen line from 1 to 7 : "))
15-
if usr_selection >0 and usr_selection < 8:
16-
print ( str(usr_selection) + ") " + a_line[usr_selection] )
17-
else:
18-
print ( str(usr_selection) + ") " + "Not a permitted number" )
19-
13+
# get user selection - note there is basic input validation
14+
try:
15+
usr_selection = int(input("Enter your chosen line from 1 to 7 : "))
16+
if usr_selection > 0 and usr_selection < 8:
17+
print ( str(usr_selection) + ") " + a_line[usr_selection] )
18+
else:
19+
print ( str(usr_selection) + ") " + "Not a permitted number" )
20+
except ValueError:
21+
print ("Invalid data entry detected. \nPlease try again.")

Assessment/Wk4/magpie_invalid_str.jpg

71.3 KB
Loading

Assessment/Wk4/password.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
test_pass=input("Please enter the password: ")
88

99
if valid_pass.upper()==test_pass.upper():
10-
print ( "Welcome to the Realms of XKCD" )
10+
print ( "Welcome to the Realms of XKCD. [https://xkcd.com/936/]" )
11+
else:
12+
print ( "Sorry that password is incorrect.")

Assessment/Wk4/password_invalid.jpg

-7.04 KB
Loading

Assessment/Wk4/password_valid.jpg

-2.42 KB
Loading

Assessment/Wk6/rainfall.png

-4.77 KB
Loading

Assessment/Wk8/initials.jpg

1.45 KB
Loading

0 commit comments

Comments
 (0)