承接国内外服务器租用托管、定制开发、网站代运营、网站seo优化托管接单、网站代更新,新老站点皆可!!咨询QQ:3787320601

python什么函数可以返回元组

管理员 2023-03-27 09:54:27 互联网圈 114 ℃ 0 评论 824字 收藏

python甚么函数可以返回元组

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

文章来源:丸子建站

文章标题:python什么函数可以返回元组

https://www.wanzijz.com/view/4643.html

TAG: python 元组

相关文章

Related articles

X

截屏,微信识别二维码

微信号:weimawl

(点击微信号复制,添加好友)

打开微信