當前位置:成語大全網 - 新華字典 - python如何用元組輸入10個數

python如何用元組輸入10個數

a=tuple([j for j in range(10)])#用tuple列表轉元組

b=tuple([1,9,8,78,63,22,45,45.8,77,6])#用tuple列表轉元組,

c=(1,9,8,78,63,22,45,45.8,77,6)#直接用小括號()

print(a)

print(b)

print(c)