MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / checkKey

Function checkKey

src/gamesbyexample/simplesubcipher.py:71–80  ·  view source on GitHub ↗

Return True if key is valid. Otherwise return False.

(key)

Source from the content-addressed store, hash-verified

69
70
71def checkKey(key):
72 """Return True if key is valid. Otherwise return False."""
73 keyList = list(key)
74 lettersList = list(LETTERS)
75 keyList.sort()
76 lettersList.sort()
77 if keyList != lettersList:
78 print('There is an error in the key or symbol set.')
79 return False
80 return True
81
82
83def encryptMessage(message, key):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected