美文网首页
笨办法学Python ex12

笨办法学Python ex12

作者: Joemini | 来源:发表于2016-12-10 21:09 被阅读0次

提示别人


  • 输入:
# -- coding: utf-8 --

age = raw_input("How old are you?")
height = raw_input("How tall are you?")
weight = raw_input("How much do you weight?")

print "So, you're %r old, %r tall and %r heavy." % (
    age, height, weight)

  • 运行:



附加题

  • 1.在命令行界面下运行你的程序,然后在命令行输入 pydoc raw_input 看它说了些什么。如果你用的是 Window,那就试一下 python -m pydoc raw_input 。
  • 2.pydoc
    pydoc是Python自带的模块,主要用于从python模块中自动生成文档,这些文档可以基于文本呈现的、也可以生成WEB 页面的,还可以在服务器上以浏览器的方式呈现!
  • 3.使用 pydoc 再看一下 open, file, os, 和 sys 的含义。

相关文章

网友评论

      本文标题:笨办法学Python ex12

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