-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgettingStarted.py
More file actions
executable file
·54 lines (48 loc) · 2.88 KB
/
gettingStarted.py
File metadata and controls
executable file
·54 lines (48 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
### welcome_assignment_answers
### Input - All nine questions given in the assignment.
### Output - The right answer for the specific question.
def welcome_assignment_answers(question):
# Students do not have to follow the skeleton for this assignment.
# Another way to implement is using a "case" statements similar to C.
if question == "Are encoding and encryption the same? - Yes/No":
answer = "No"
elif question == "Is it possible to decrypt a message without a key? - Yes/No":
answer = "No"
elif question == "Is it possible to decode a message without a key? - Yes/No":
answer = "Yes"
elif question == "Is a hashed message supposed to be un-hashed? - Yes/No":
answer = "No"
elif question == "What is the SHA256 hashing value to the following message: 'NYU Computer Networking' - Use SHA256 hash generator and use the answer in your code":
answer = "883C13DA6A24949C9A23231B60119E2ACE58459DA4F8BBDD812CC37764548BDD"
elif question == "Is MD5 a secured hashing algorithm? - Yes/No":
answer = "No"
elif question == "What layer of the TCP/IP model does the protocol DNS belong to? - The answer should be an " \
"integer number":
answer = 5
elif question == "What layer of the TCP/IP model does the protocol ICMP belong to? - The answer should be an " \
"integer number":
answer = 3
elif question == "In Slack, what is the secret passphrase posted in the #lab-python-getting-started channel " \
"posted by a TA?":
answer = "mTCP"
else:
### you should understand why this else case should be included
### what happens if there is a typo in one of the questions?
### maybe put something here to flag an issue
answer = "Issue"
return (answer)
# Complete all the questions.
if __name__ == "__main__":
# use this space to debug and verify that the program works
debug_question = "Are encoding and encryption the same? - Yes/No"
print(welcome_assignment_answers(debug_question))
# Questions:
# "In Slack, what is the secret passphrase posted in the #lab-python-getting-started channel posted by a TA?":
# "Are encoding and encryption the same? - Yes/No":
# "Is it possible to decrypt a message without a key? - Yes/No":
# "Is it possible to decode a message without a key? - Yes/No":
# "Is a hashed message supposed to be un-hashed? - Yes/No":
# "What is the SHA256 hashing value to the following message: 'NYU Computer Networking' - Use SHA256 hash generator and use the answer in your code":
# "Is MD5 a secured hashing algorithm? - Yes/No":
# "What layer of the TCP/IP model does the protocol DNS belong to? - The answer should be an integer number":
# "What layer of the TCP/IP model does the protocol ICMP belong to? - The answer should be an integer number":