python基础学习笔记——Python基础教程(第2版 修订版)第四章(条件,循环,其他)

#条件和条件语句

False None 0 “” () [] {}

#比较运算符

x is y #x和y是同一对象
x in y #x是一容器成员
x not in y

#for  for number in range(1,101)

#迭代工具

zip(name,ages)
for name.age in zip(name,age)

#跳出循环

break
continue

#pass  什么都不做

#exec

from math import sqrt
scope={}
exec'sqrt=1'in scope
sqrt(4)
2.0
scope['sqrt']
1   #放置命名空间 不影响原来函数 只在它的作用域内有效

#eval

 

posted @ 2017-09-03 19:05  不可叽叽歪歪  阅读(125)  评论(0编辑  收藏  举报