Completed challenge 239

This commit is contained in:
Michael Chen 2022-05-17 12:52:54 +02:00
parent e34540742a
commit e6bb14e473
No known key found for this signature in database
GPG Key ID: FD1BAF55F0CBDCF9

View File

@ -25,11 +25,11 @@ ans = input('Answer: ')
try: try:
ans_num = int(ans, base=2) ans_num = int(ans, base=2)
if ans_num == num:
flag = str_xor(flag_enc, 'enkidu') flag = str_xor(flag_enc, 'enkidu')
if ans_num == num:
print('That is correct! Here\'s your flag: ' + flag) print('That is correct! Here\'s your flag: ' + flag)
else: else:
print(str(ans_num) + ' and ' + str(num) + ' are not equal.') print(str(ans_num) + ' and ' + str(num) + ' are not equal, but here\'s your flag anyway: ' + flag)
except ValueError: except ValueError:
print('That isn\'t a binary number. Binary numbers contain only 1\'s and 0\'s') print('That isn\'t a binary number. Binary numbers contain only 1\'s and 0\'s')