Apr-15-2018, 11:51 AM
Hi All,
Sorry if this seems like a basic question. I am trying to understand part of the code for Caesar Cipher and would be grateful if you guys can give some advice.
def getKey():
key = 0 Why do we need to define key=0?
while True: Why do we need to state while true?
print('Enter the key number (1-%s)' % (MAX_KEY_SIZE))"(1-%s)' % (MAX_KEY_SIZE)" what does this mean?
key = int(input())how does 'input()' come into play in this context (As in I do not understand where input is referring to
if (key >= 1 and key <= MAX_KEY_SIZE):
return key
Sorry if these are basics, I am just having a hard time conceptualising it.
Many thanks!
Sorry if this seems like a basic question. I am trying to understand part of the code for Caesar Cipher and would be grateful if you guys can give some advice.
def getKey():
key = 0 Why do we need to define key=0?
while True: Why do we need to state while true?
print('Enter the key number (1-%s)' % (MAX_KEY_SIZE))"(1-%s)' % (MAX_KEY_SIZE)" what does this mean?
key = int(input())how does 'input()' come into play in this context (As in I do not understand where input is referring to
if (key >= 1 and key <= MAX_KEY_SIZE):
return key
Sorry if these are basics, I am just having a hard time conceptualising it.
Many thanks!