Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py记录:字典, 逻辑判断,循环,遍历(2016.05.12) #2

Open
xhl2791188 opened this issue May 12, 2016 · 0 comments
Open

Comments

@xhl2791188
Copy link
Owner

字典的定义和操作

eg:dic = {'name':'Jerry','age':34,'sex':'man'}
增加、更新、删除
dic.pop('name') //删除病返回键为name的元素
del dic['name'] //删除键为name的元素
dic.clear()//清空
del dic// 删除字典

if else语句

if 判断:
print
elif 判断:
print
else 判断:
print

and or not

for循环

for x in range(起始值,终止值,步长值)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant