python - 如何计算两个指数数之差
问题描述
我想用python计算两个指数数之间的差
a = 4,592e+9
b = 7,892e+9
c = b - a
print ('c = ',c)
我收到以下错误消息:
TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'
解决方案
只需替换,
为.
a = 4.592e+9
b = 7.892e+9
c = b - a
print ('c = ',c)
推荐阅读
- python - NameError:名称'run_once'未在python中定义
- c# - 将 UTF8 文本编码为 Unicode C#
- php - 如何在 Php 中缩进一个长的三元条件?
- python - 在python中猜数字
- react-native - TouchableOpacity 中的绝对定位视图不会在 React Native 中显示
- php - 如果需要 CSRF-Token(PHP、SSO、LDAP),如何自动登录到另一个站点
- linux - AF_XDP 不适用于内核`4.18.0-25-generic`
- reactjs - Dotenv 在生产环境中不起作用(Create-React-App、AWS)
- python - 使用 Python 从 Oracle 数据库创建 Excel 或 CSV 报告
- jquery - 如何在动态添加的新选择中添加选择选择器设置?