Remove .md and image files and move python files into main chapter folders
This commit is contained in:
parent
5978779a9a
commit
67806dab6a
159 changed files with 0 additions and 4562 deletions
|
|
@ -1,24 +0,0 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 9
|
||||
# Problem 18
|
||||
|
||||
import string
|
||||
|
||||
def encrypt(msg, code):
|
||||
alpha = string.ascii_lowercase
|
||||
newStr = ""
|
||||
pos = 0
|
||||
msg = msg.lower()
|
||||
|
||||
for char in msg:
|
||||
if char in alpha:
|
||||
pos = alpha.index(char)
|
||||
newStr += newAlpha[pos]
|
||||
else:
|
||||
newStr += char # no rules apply so keep the character
|
||||
|
||||
return newStr
|
||||
|
||||
newAlpha = "qwertyuiopasdfghjklzxcvbnm"
|
||||
|
||||
print(encrypt("Hello World!", newAlpha))
|
||||
Loading…
Reference in a new issue