摘要: >>> mix = [2,3.4,"abc",'中国',True,['ab',23]]>>> mix[2, 3.4, 'abc', '中国', True, ['ab', 23]]>>> nothing = []>>> nothing[]>>> len(mix)6>>> mix.append('飞狐外 阅读全文
posted @ 2017-03-18 22:51 xiongjiawei 阅读(166) 评论(0) 推荐(0) 编辑
摘要: >>> exp='welcom to python'>>> for i in exp: print(i,end=' ') w e l c o m t o p y t h o n >>> >>> weeks=['星期一','星期二','星期三','星期四','星期五','星期六','星期天']>>> 阅读全文
posted @ 2017-03-18 22:04 xiongjiawei 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 三元操作符 阅读全文
posted @ 2017-03-18 21:52 xiongjiawei 阅读(1443) 评论(0) 推荐(0) 编辑
摘要: 1 >>> a=520 2 >>> type(a) 3 4 >>> a='520' 5 >>> type(a) 6 7 >>> a=5.2 8 >>> type(a) 9 10 >>> a=True 11 >>> type(a) 12 1 >>> a=True 2 >>> type(a) 3 4 >>> isinstance(a,bool) 5 Tr... 阅读全文
posted @ 2017-03-18 20:22 xiongjiawei 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 1 >>> name='萧峰' 2 >>> print(name) 3 萧峰 4 >>> name="独孤求败" 5 >>> print(name) 6 独孤求败 7 >>> 1 >>> p='C:\Users\lenovo\Desktop\python' 2 SyntaxError: (unicode error) 'unicodeescape' codec can't deco... 阅读全文
posted @ 2017-03-18 18:54 xiongjiawei 阅读(10466) 评论(0) 推荐(0) 编辑
摘要: 1 Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32 2 Type "copyright", "credits" or "license()" for more 阅读全文
posted @ 2017-03-18 18:12 xiongjiawei 阅读(1013) 评论(0) 推荐(0) 编辑
摘要: 1 import random 2 luckyNum=random.randint(2,9) 3 i=1 4 while i<=3: 5 guessNum=input("请你猜猜我的幸运号码:") 6 guessNnmToInt=int(guessNum) 7 if luckyNum==guessN 阅读全文
posted @ 2017-03-18 18:07 xiongjiawei 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-03-18 17:30 xiongjiawei 阅读(189) 评论(0) 推荐(0) 编辑