Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import sys
  2.  
  3. def verify(guess):
  4.     vals = [
  5.         83,
  6.         75,
  7.         89,
  8.         45,
  9.         79,
  10.         82,
  11.         68,
  12.         83,
  13.         45,
  14.         55,
  15.         57,
  16.         50,
  17.         54,
  18.     ]
  19.  
  20.     if len(guess) != 13:
  21.         return False
  22.  
  23.     for i, c in enumerate(guess):
  24.         if ord(c) != vals[i]:
  25.             return False
  26.     return True
  27.  
  28.  
  29. if len(sys.argv) != 1:
  30.     print "Usage: python check.pyc"
  31.     exit(1)
  32.  
  33. guess = raw_input("Enter your guess for the flag: ");
  34.  
  35. if verify(guess):
  36.     print "That's the correct flag!"
  37. else:
  38.     print "Wrong flag."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement