Python 資料型態與基本運算
x = True
print(x)
type(x)
x = 10
print(x)
type(x)
x = 3.1416
print(x)
type(x)
round(x,3) #取小數點第幾位,四捨五入
x = 'Hello'
print(x)
type(x)
1+2
1-2
1*2
1/2
3//2 ##無條件捨去
3**2 ##次方
10%3 #餘數
#==========
a = 1 + 2
b = 3
a == b # a = b 的寫法
#==========
a = 1 + 2
b = 4
a = b
a
#==========
a = 1 + 2
b = 3
a != b # a 不等於 b 寫法
#==========
(3>4) #not 為不是
#not(3>4)
#==========
(4>3) and (3>4) #需兩個條件都對才成立
#==========
(4>3) or (3>4) #一個條件對,即成立
#==========
type(99.2)
a=str(99.2)
type(a)
#==========
type('100')
a=int('100')
type(a)
#==========
type('193.2')
a=float('193.2')
type(a)




