标签:zed where adc live san 调用 输入 about http
一 主要语法
本次习题的主要语法内容是:用一种不同的方式使用input ,就是让它打印出一个简单的 > 提示符。
二 代码及运行结果
1 代码:
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 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 sure where that is. And you have a {computer} computer.Nice. """)
2 运行结果
PS E:\3_work\4_python\2_code\02_LearnPythonTheHardWay> python ex14.py Zed Hi Zed,I‘m the ex14.py script. I‘d like to ask you a few questions. Do you like me Zed? >>> Yes Where do you live Zed? >>> San Francisico What kind of computer do you have? >>> Tandy 1000 Alright, so you said Yes about liking me. You live in San Francisico.Not sure where that is. And you have a Tandy 1000 computer.Nice.
三 游戏
1 zork游戏:https://www.douban.com/group/topic/21962101/
2 Adcenture:https://baijiahao.baidu.com/s?id=1632958318937965675&wfr=spider&for=pc
标签:zed where adc live san 调用 输入 about http
原文地址:https://www.cnblogs.com/luoxun/p/13200883.html