prev next | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
Your computer is better than any calculator at doing math. Let's try some.
>>> print 2+33+66 101 >>> print 33333333 * 44444444 1481481451851852 >>> n=123456789 >>> print n*n*n 1881676371789154860897069 >>>
In Python, plus and minus are normal but times and divide are done using the * and / symbol. Some other symbols to know:
|
|
|
What will it do when we say "len(str(1234))"?
Try your own fancy formulas. Don't worry if you get errors.