美文网首页
习题 14: 提示和传递

习题 14: 提示和传递

作者: only_Fisher | 来源:发表于2020-05-23 16:07 被阅读0次

三个双引号除了注释还有定义多行字符串的功能,并且中间不需要换行\n
https://blog.csdn.net/Dontla/article/details/103476041

script, user_name = argv 
prompt = '> ' 
 
print ("Hi %s, I'm the %s script." % (user_name, script) )
print ("I'd like to ask you a few questions." )
print ("Do you like me %s?" % user_name )
likes = input(prompt) 
 
print ("Where do you live %s?" % user_name )
lives = input(prompt) 
 
print ("What kind of computer do you have?" )
computer = input(prompt) 
 
 
print  (
"""
 Alright, so you said %r about liking me.
 You live in %r. 
 Not sure where that is.
 And you have a %r computer.  
 Nice.
"""
  
 % (likes, lives, computer) )
QQ浏览器截图20200512180206.png

这游戏感觉没什么意思,有时间不如去玩点3A大作
http://www.yxdown.com/SoftView/SoftView_231080.html

我是一个学python的小白,如果有错误可以评论告诉我,不胜感激。

相关文章

  • 习题 14: 提示和传递

    三个双引号除了注释还有定义多行字符串的功能,并且中间不需要换行\nhttps://blog.csdn.net/Do...

  • 练习14 提示和传递

    from sys import argv script,user_name,computer= argvpromp...

  • 笨方法学Python-习题14-提示和传递

    本习题中使用argv和input,继续讨论和用户交互的话题。 运行下,仔细品品是如何交互的。 这道习题中依旧是问题...

  • 【Python爬虫】-笨办法学 Python 习题13-17

    习题13 习题14 习题15 习题16 习题17

  • 【Python爬虫】-第二周 习题 13-17 (解包,参数,文

    习题 13-17 (解包,参数,文件读写等) 习题13 习题14 习题15 习题16 16-1 16-2 习题17...

  • C++ 引用传递的学习

    C++ 引用与引用作为函数的参数C++函数的三种传递方式为:值传递、指针传递和引用传递 C++ 上课习题 刘月林2...

  • Ruby19

    看到第习题14了@()@!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...

  • 习题 12: 提示别人

    这一节也没什么,就比上一节多了个提示。顺便复习一下上一节的内容。 一开始按他说的我输入了一个python -m p...

  • 2018-12-03 D13

    提示和传递 将用户提示符设置为变量 prompt,这样我们就不需要在每次用到 raw_input 时重复输入提示 ...

  • Day_2

    进度:习题10-17 提示 '''print'what's your name? '''' 转义序列 ‘ ' ’ ...

网友评论

      本文标题:习题 14: 提示和传递

      本文链接:https://www.haomeiwen.com/subject/umqlahtx.html