HOMEWORKS:
DTs will be set for those who have not done their homeworks 4 and 5, as set my Mr Smith.
LO to understand how to store and look up values from a list
Teachers' Slides - Secret Messages
(Remind Miss to print this off! - Wheel
Copy and paste your code into your google doc on google classroom. Lessson 3
Code for extension task - there could be errors, so be prepared to correct them :)
letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
numberShift = int(input("How much do you wish to shift the letters? "))
phrase = input("Enter a phrase to encrypt: ")
newPhrase = ""
for l in phrase:
if l in letters:
pos = letters.index(l) + numberShift
if pos > 25:
pos = pos - 26
newPhrase += letters[pos]
else:
newPhrase += " "
print (newPhrase)
No comments:
Post a Comment