python创建函数、可以接受任意多个整数参数并求和_只取整数求和并创建一个平均python...

嗨,我的一个函数的输出是average = ['2.06556473829 is the average for a',

'1.48154269972 is the average for b',

'1.56749311295 is the average for c',

'2.29421487603 is the average for d',

'1.51074380165 is the average for e',

'1.46997245179 is the average for f',

'1.15950413223 is the average for g',

'1.94159779614 is the average for h',

'1.48236914601 is the rainfall average for i',

'1.2914600551 is the average for j']

我要做的是只取列表中所有的整数,即2.06555、1.222等等。

将它们相加,然后将总和除以列表中的项数,然后打印结果

目前我有一个总变量

^{pr2}$

然而,我的代码似乎不允许我找出所有的整数并求和。不管怎样,我能只找出整数求和,然后求平均值吗?在

谢谢你的帮助。在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值