LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1786|回复: 6

python 问题

[复制链接]
发表于 2010-9-15 13:37:51 | 显示全部楼层 |阅读模式
为什么程序1和2执行的结果不一样。
就是print语句对齐不一样。

看过了python语法之后就明白了。
1--------------------------------------------------------------
while True:
  s = raw_input('Enter something:')
  if s == 'quit':
     break
  if len(s) < 3:
     continue
.    print 'Input is of sufficient length'


2--------------------------------------------------------------
while True:
  s = raw_input('Enter something:')
  if s == 'quit':
     break
  if len(s) < 3:
     continue
print 'Input is of sufficient length'
发表于 2010-9-16 06:58:16 | 显示全部楼层
没有缩进,这叫人怎么看呀。
回复 支持 反对

使用道具 举报

发表于 2010-9-16 14:15:18 | 显示全部楼层
Post by gorf;2112449
没有缩进,这叫人怎么看呀。


949494
回复 支持 反对

使用道具 举报

发表于 2010-9-19 15:14:52 | 显示全部楼层
楼主啊,你要是个bash,没有缩进也就罢了,python没有缩进……

Post by gorf;2112449
没有缩进,这叫人怎么看呀。
回复 支持 反对

使用道具 举报

发表于 2010-9-21 17:53:51 | 显示全部楼层

  1. while True:
  2.     s = raw_input('Enter something:')
  3.     if s == 'quit':
  4.         break
  5.     if len(s) < 3:
  6.         continue
  7.     print 'Input is of sufficient length'
复制代码
回复 支持 反对

使用道具 举报

发表于 2010-11-28 00:06:01 | 显示全部楼层
这只是其中一个吧。另一个的缩进是什么呢?
没有缩进,简直就是天书啊。
回复 支持 反对

使用道具 举报

发表于 2011-10-3 18:35:32 | 显示全部楼层

I'm sure they will come up with some bullkaki reason for their actions,cheap moncler, like there not making enough since the lock out!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表