溫馨提示×

python什么函數可以返回元組

九三
907
2021-02-09 09:36:08
欄目: 編程語言

python什么函數可以返回元組

在python中使用format函數返回元祖,具體方法如下:

1.首先,在python中定義一個元組;

def measure():

temp = 39;

wetness = 50

trturn temp,wetness

2.元組定義好后,使用format函數即可返回元組;

def measure():

temp = 39;

wetness = 50

trturn temp,wetness

temp_1,wetenss_1 = measure()

print('temp:{}'.format(temp_1))

print('wetness:{}'.format(wetness_1))

輸出結果為:

temp:39

wetness:50

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女