Tuesday, 30 August 2016

Python Programming Tutorial - 2 - Numbers

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 3 * 20
60
>>> 12 /4
3.0
>>> 12 / 4
3.0
>>> 8 + 2 * 10
28
>>> (8 + 2 ) * 10
100
>>> 10 / 4
2.5
>>> 18 / 4
4.5
>>> 18 % 4
2
>>> 5 * 5 * 5
125
>>> 5 ** 3
125
>>> tuna = 5
>>> 20 + tuna
25
>>> bacon = 18
>>> tuna = 5
>>> bacon / tuna
3.6
>>>

No comments:

Post a Comment