
#數(shù)據(jù)類型:整形,浮點(diǎn),字符串,布爾
#ython把0、空字符串''和None看成 False,其他數(shù)值和非空字符串都看成 True
print(45678+0x12fd2)
print(11.2+10.00)
print('learn Python in imooc')
print(0xff==255)
#字符串'.號'表空格
print('hello, python')
print('hello,','python')
#字符串,轉(zhuǎn)義符號,r'''...'''
s ='Python was started in 1989 by \"Guido\".\nPython is free and easy to learn.'
print(s)
print (r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
#字符串運(yùn)算
s="bai"
s1="wuguang"
print(s[0:-1]);
print(s+s1);
#變量,范類型
x1=1
d=3
n=100
x100=x1+(n-1)*d
s=(x1+x100)*n/2
print(s)
#list
li=['新月打擊','蒼白之瀑','月神降臨','月神沖刺'];
print(li[0:2])
print(li[-1])#打印出單個(gè)
print(li[-1:])#打印出列表
print(1 not in li)#判斷是否是在列表中
print(len(li))#長度
#元組 tuple
print(type((1,'-1',True)))
#int 類型
print(type((1)))
#tuple類型
print(type((1,)))
#typle類型
print(type(()))
#集合
s1={1,2,3,4,5,6}
s2={1,2,3,4,5,7,8}
print(type(s1))
print(s1-s2)#除去
print(s1&s2)#共同
print(s1|s2)#相加
#字典
d={'Q':'新月打擊','W':'蒼白之瀑','E':'月之降臨,'R':月神沖刺'}
print(type({}))#空的字典
print(d['Q'])#輸出新月打擊