Some basic arithmetic operations in Python 2.7
Addition
>>> 7+14
21
Subtraction
>>> 14-7
7
Multiplication
>>> 7*14
98
Division
>>> 14/7
2
Floor division
>>> 15//7
2
Exponent
>>> 7**2
49
Working with equations
>>> x=7
>>> y = 14
>>> x*y
98
>>> x=7
>>> y=14
>>> z=x*y
>>> print z
98
>>> x=14
>>> y=7
>>> z=(x+y)*x
>>> z
294
Comparison operations in Python 2.7
>>> 7==7
True
>>> 7==14
False
>>> 7<7
False
>>> 7<14
True
>>> 14>7
True
>>> 7<14>6
True
I believe I covered most of the arithmetic operations in Python 2.7. I am providing only examples because I believe it's the best way to learn. You will notice that I am giving very basic examples. This is because I want you to advance slowly and to start loving programming in Python.
Python is widely spread programming language used in many branches and from thousands of programmers. Earning potential with Python is unlimited. You can apply for projects everywhere. you can even create the projects and starting earning thousands of dollars.
Feel free to contact me if you have any questions.
No comments:
Post a Comment