Advertisement
here2share

# secure_if_raw_input.py -- by adding strip()

Jan 24th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. # secure_if_raw_input.py -- by adding strip()
  2.  
  3. for i in range(5):
  4.     text = raw_input("y/n: ").strip()
  5.  
  6.     if text.lower() in ['y','yes']:
  7.         # demo
  8.         import random
  9.         for ii in range(20):
  10.             print random.choice(range(5, 10))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement