TypeError unsupported opperands types | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

TypeError unsupported opperands types

Write a program to calculate the amount that will result from the doubling to understand which choice results in a larger amount. Iā€™m getting a typeError when running this any help will be appreciated. Thanks a = 1000000 x = range(1, 31) b = pow(0.01, x) sum = 0 total = sum + b if a > total: print("a is great") else: print("total is great")

16th Nov 2020, 12:02 PM
rola
2 Respostas
0
x is not a number, it's a range. Therefore, you cannot use it in pow function.
16th Nov 2020, 12:20 PM
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ
ä½ ēŸ„é“č¦å‰‡ļ¼Œęˆ‘也ę˜Æ - avatar
0
thanks for replying
16th Nov 2020, 3:35 PM
rola