Chinaunix首页 | 论坛 | 博客
  • 博客访问: 295532
  • 博文数量: 47
  • 博客积分: 1190
  • 博客等级: 少尉
  • 技术积分: 523
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-14 20:30
文章分类

全部博文(47)

文章存档

2016年(1)

2012年(46)

我的朋友

分类: Python/Ruby

2012-09-12 15:43:10

E.g:
soc_id = soc_type[2:]

       if soc_id in [61, 63]:
            print soc_id

soc_id将不会被打印,这是因为soc_id是string, 必须先使用int(soc_id)才行。
这里的教训是python中虽然没有类型声明,但变量类型在第一次赋值时已经确定了。

阅读(1178) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~