首页 > 代码库 > 第一篇博客 用笨办法学python-14 提示和传递
第一篇博客 用笨办法学python-14 提示和传递
# 代码如下:
usr_name = input("")
script = input("")
prompt = ‘> ‘
print("hi %s,i‘m the %s script."% (usr_name,script))
print("i‘d like to ask u some questions.")
print("do u like me %s ?"% usr_name )
likes = input(prompt)
print("where do u live %s?"% usr_name)
lives = input(prompt)
print("what kind of computer do you have?")
computer = input(prompt)
print(
‘‘‘
alright. so u said %r about liking me.
u live in %r . not sure where that is.
and u have a %r computer. nice!
‘‘‘
%(likes, lives, computer)
)
#在pad上写跟电脑上不太一样,头两行本该是:
from sys import argv
script,usr_name = argv
在pad上会报错,就改成了:
usr_name = input()
script = input()
第一篇博客 用笨办法学python-14 提示和传递
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。