diff options
Diffstat (limited to 'comp/hw/113/1.py')
-rw-r--r-- | comp/hw/113/1.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/comp/hw/113/1.py b/comp/hw/113/1.py new file mode 100644 index 0000000..d0e743b --- /dev/null +++ b/comp/hw/113/1.py @@ -0,0 +1,11 @@ +import random +serverPortNames = [["http", 80], ["ftp control", 21], ["ftp data", 20], ["https", 443], ["pop3", 110], ["smtp", 25], ["ssh (the best one)", 22]] + +while len(serverPortNames) != 0: + randNum = random.randint(0, len(serverPortNames) - 1) + ans = int(input(f"what is the port number of {serverPortNames[randNum][0]}: ")) + if ans == serverPortNames[randNum][1]: + print("you did it!") + serverPortNames.pop(randNum) + else: + print("you got it wrong, sorry") |