标签:print author /usr 比较 not 技术 class false blog
如:
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan print(10%2) #求模(取模) # 0 print(11%2) # 1 print(8%2.5) #0.5 print(10//3) #取整除 # 3 print(-10//3) # -4
注意:不等于一般用 != ,别用 <>
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan a = [1,2,3,4] print(1 in a) #True print(0 in a) #False print(0 not in a) #True
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan a = [1,2,3,4,5] print(type(a) is list) #True print(type("123") is str) #True print(type(123) is int) #True print(type("123") is not int) #True
如:
标签:print author /usr 比较 not 技术 class false blog
原文地址:http://www.cnblogs.com/hiuhungwan/p/7684658.html