Python学习记录贴
#!/bin/env python #-*- coding:utf8 -*- #学python的记录 #练习一天~ # adict = dict([('name','bob'),('age',25)]) # print(len(adict)) # print(adict) # a = hash(100) #判断给定的数据是不是不可变的,不可变数据才能作为key # print(a) # a = adict.keys() #取出所有字典的key # print(a) # a = adict.values() #取出字典所有的value # print(a) # a = adict.items() #取出key:value对 # print(a) # #get方法常用很重要 # print(adict.get('name')) #取出字典中name对应的value,如果没有则返回None # print(adict.get('qq')) #None # print(adict.get('qq','not found')) #没有qq,返回指定内容:not found # function(){ //外汇返佣:http://www.fx61.com # print(adict.get('age','not found')) # a = adict.update({'phone':