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
版权声明
本文仅代表作者观点,不代表米安网络立场。
上一篇:java中的抽象类有哪些 下一篇:idc机柜租用价格是多少
发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。