-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex14.py
More file actions
33 lines (25 loc) · 901 Bytes
/
ex14.py
File metadata and controls
33 lines (25 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
""" Prompting and Passing """
from __future__ import print_function, division
from builtins import input # pylint: disable=redefined-builtin
from sys import argv
def main():
""" Main routine """
# pylint: disable=unbalanced-tuple-unpacking
script, user_name = argv
prompt = "> "
print("Hi {}, I'm the {} script.".format(user_name, script))
print("I'd like to ask you a few questions.")
print("Do you like me {}?".format(user_name))
likes = input(prompt)
print("Where do you live {}?".format(user_name))
lives = input(prompt)
print("What kind of computer do you have?")
computer = input(prompt)
print("""
Alright, so you said {!r} about liking me.
You live in {!r}. Not sure where that is.
And you have a {!r} computer. Nice.
""".format(likes, lives, computer))
if __name__ == "__main__":
main()