首页 > 代码库 > 第一篇博客 用笨办法学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 提示和传递