-1

Python is being weird again. When I put 5 * (40 ^ 2) + 50 * 40 + 100 it returns 2310. But on a calculator its 10100. I don't know why Python is making this mistake nor how to fix it. Anyone got any ideas?

Lloyd
  • 95
  • 1
  • 8

2 Answers2

1

If you will write

print( 5 * 40 ** 2 + 50 * 40 + 100 )

you will get the expected result.

10100
Vlad from Moscow
  • 301,070
  • 26
  • 186
  • 335
0

Try this instead:

5 * (40 ** 2) + 50 * 40 + 100

LynneKLR
  • 90
  • 1
  • 8