Integer calculation in Python

In this post, we will look how to do integer calculation in python.

As we know there is no explicit declaration of variables required, hence we can do the calculation in simple format.

Lets see how to perform integer calculation in python.

Integer calculation in Python

user@ngelinux$ cat fifth.py 
#!/usr/local/bin/python3

### Number or Integer calculation in Python
a = 5
b = 4
total = a+b
print(total)

### Variables can be initialized together also in python
c,d=5,6
print(c,d)
user@ngelinux$ 

Output

user@ngelinux$ ./fifth.py 
9
5 6

Leave a Reply

Your email address will not be published.