学习python第n''天——我在看笨办法学python(提示和传递)
这是所有的语言
from sys import argv
script, user_name = argv
prompt = '> '
print(f"Hi {user_name}, I'm the {script} script.")
print("I'd like to ask you some question.")
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 sure where that is.
And you have a {computer} computer. Nice.
""")
这是所有的运行结果
PS C:\Users\HH\lpthw> python ex3.py HH
Hi HH, I'm the ex3.py script.
I'd like to ask you some question.
Do you like me HH?
> Yes
where do you live, HH?
> CBD
what kind of computer do you have?
> Lenovo
Alright, so you said Yes about liking me.
You live in CBD. Not sure where that is.
And you have a Lenovo computer. Nice.
PS C:\Users\HH\lpthw>
浙公网安备 33010602011771号