LearnPythonTheHardWay2ndEdit第0-12节学习笔记

learn python once again - -


前12节也就 print raw_input 和 %r %s 格式输出的内容了

总结一下陌生的东西吧:

1、配置 Python 使得 Windows cmd 可用


2、raw_input() 与 input() 的区别?

    raw_input() 就是对用户输入进行读取,所有输入的内容都以字符串格式读入,对于 input 希望读入的是 python 格式化数据,所以 abc = input(abc) 是不可以的,abc = input('abc') 才可以

abc = raw_input("try to print abc: ")
print "abc=", abc # this is ok

abc = raw_input("try to print abc: ")
print "abc=", abc # this is NOT ok

Traceback (most recent call last):
  File "C:/Python27/mystuff/test.py", line 1, in <module>
    abc = input("try to print abc: ")
  File "<string>", line 1, in <module>
NameError: name 'abc' is not defined

3、%r 和 %s 的区别 (还没弄明白)

abc = 'abc'
bcd = "bcd"

print "abc = %r bcd = %r", %(abc, bcd)

print "abc = %r bcd = %r", %(abc, bcd)

http://segmentfault.com/q/1010000000163896


4、pydoc的使用(暂时还用不了)



时间进度:

15:03-15:56  exercise 0-4

           -16:14  exercise 5

           -16:23  exercise 6

           -16:31  exercise 7

           -16:59  exercise 8

           -17:03  exercise 9

           -17:09  exercise 10

           -17:36  exercise 11

           -17:58  exercise 12

           -18:22  exercise 13


上班儿还可以学python - -




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值