[Python #2] create e14.py
This commit is contained in:
parent
adfc2fe765
commit
5b5bfe07ca
2 changed files with 25 additions and 0 deletions
23
kjg/python-the-hard-way/e14.py
Normal file
23
kjg/python-the-hard-way/e14.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from sys import argv
|
||||
|
||||
script, user_name, first, second = argv
|
||||
prompt = '==> '
|
||||
|
||||
print(f"Hi {user_name}, I'm the {script} script.")
|
||||
print("I'd like to ask you a few questions.")
|
||||
print(f"Do you like me {user_name}?")
|
||||
likes = input(prompt)
|
||||
|
||||
print(f"Where do you live {user_name}?")
|
||||
lives = input(prompt)
|
||||
|
||||
print(f"What kind of computer do you have?")
|
||||
computer = input(prompt)
|
||||
|
||||
print(f"""
|
||||
Alright, so you said {likes} about liking me.
|
||||
You live in {lives}. Not suer where that is.
|
||||
And you have a {computer} computer. Nice.
|
||||
{first} and {second}
|
||||
""")
|
||||
|
|
@ -79,3 +79,5 @@ how to use key input
|
|||
how to use key input with print
|
||||
**** ex13
|
||||
how to use an argument when you run script
|
||||
**** ex14
|
||||
how to use an argument with input
|
||||
|
|
Loading…
Reference in a new issue