pleabargain

learn python3 the hard way lesson 14

May 3rd, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. #http://learnpythonthehardway.org/book/ex14.html
  2. # run this script passing 1 argument
  3. #eg
  4. #C:\Python33>python PTHW14.py NAME
  5. from sys import argv
  6.  
  7. script, user_name= argv
  8. prompt = '>'
  9.  
  10. print ("Hi {}, I'm the {} script".format(user_name, script))
  11. print ("I'd like to ask you a few questions.")
  12. like = (input("Do you like me {}?".format(user_name)))
  13.  
  14. lives = (input("Where do you live {}?".format(user_name)))
  15.  
  16. computer = (input("What kind of computer do you have {}?".format(user_name)))
  17.  
  18. print ("""
  19. Alright, so you said {} about liking me.
  20. You live in {}. I'm not sure where that is.
  21. And you have a {} computer. Cool
  22. """.format(like,lives,computer))
Add Comment
Please, Sign In to add comment