print(int('10',16))
print(int('ff',16))
print(int("ff",16))
print(int('100',16))
print(int('100',8))
a = [0>1, 2>1, 3==3]#串列list使用square bracket中括號
print("是否all全真",all(a))
print("存在任何any一個真",any(a))
print("張心妮bin二進位輸出1到9")
for i in range(10): #0到9 進位1
print(bin(i))
for i in range(0, 200, 10):
print(hex(i))
a = ('蘋果', '香蕉', '櫻桃',"durian")
b = "Hello World"
c = 33
d ={'蘋果', '香蕉', '櫻桃',"durian"}
e=['蘋果', '香蕉', '櫻桃',"durian"]
print("a元組typle", type(a))
print("b字串", type(b))
print("c整數integer", type(c))
print(type(d), type(e))
int(a,b)將b進位的a轉成10進位
bin(a)將10進位a轉成2進位
hex(a)將10進位a轉成16進位
type(a)呈現a的型態:set集合、list串列、元組tuple、字典dictionary、整數integer、字串string
308.https://zxnhtml.blogspot.com/2024/03/pythonbuilt-infunctionsloop.html
回覆刪除