第一篇博客 用笨办法学python-14 提示和传递
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第一篇博客 用笨办法学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 提示和传递的主要内容,如果未能解决你的问题,请参考以下文章