Learning Circle : python #2 - ex13, ex14
This commit is contained in:
parent
c0b8006422
commit
b68eb529a1
4 changed files with 37 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
* 2020-05-20
|
||||
*** Python #2:
|
||||
**** TODO Lecture content
|
||||
**** DONE Lecture content
|
||||
CLOSED: [2020-05-20 수 22:47]
|
||||
- Read thoroughly & do exercises 8 to 14
|
||||
- Focus on understanding
|
||||
- You don't have to type everything
|
||||
|
|
9
youngjin.han/python-the-hard-way/ex13.py
Normal file
9
youngjin.han/python-the-hard-way/ex13.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from sys import argv
|
||||
# read the WYSS section for how to run this
|
||||
script, first, second, third, fourth = argv
|
||||
|
||||
print("The script is called:", script)
|
||||
print("Your first variable is:", first)
|
||||
print("Your second variable is:", second)
|
||||
print("Your third variable is:", third)
|
||||
print("Your fourth variable is:", fourth)
|
22
youngjin.han/python-the-hard-way/ex14.py
Normal file
22
youngjin.han/python-the-hard-way/ex14.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from sys import argv
|
||||
|
||||
script, user_name, age = 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("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 sure where that is.
|
||||
And you have a {computer} computer. Nice.
|
||||
Opps, You are {age} years old.
|
||||
""")
|
|
@ -11,6 +11,10 @@
|
|||
- ex12.py
|
||||
- pydoc input
|
||||
- describe input on python. It looks like man commnad on linux shell.
|
||||
- ex13.py
|
||||
- none
|
||||
- ex14.py
|
||||
- none
|
||||
|
||||
* 2020-05-18
|
||||
** note
|
||||
|
|
Loading…
Add table
Reference in a new issue