码迷,mamicode.com
首页 > 编程语言 > 详细

第一篇博客 用笨办法学python-14 提示和传递

时间:2016-08-27 22:07:41      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:

# 代码如下:

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 提示和传递

标签:

原文地址:http://www.cnblogs.com/zjcsweb/p/5813847.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!