Basic Calculation

#!/usr/bin/evn python

# Assign integer values in two variables
a,b = 4,2

# Sum of two variables
c = a+b
print "Sum:",c

# Substuct of two variables
c= a-b
print "Substuct:",c

# Multiplication of two variables
c = a*b
print "Multiplication:",c

# Division of two variables
c = a/b
print "Division:", c

# Modulus of two variables
c = a%b
print "Modulus:", c

# ***** Output *****
Sum: 6
Substuct: 2
Multiplication: 8
Division: 2
Modulus: 0

Comments (0)

  • To add your comment please or

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.

Got It!