Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.

Python - Performing Arithmetic Operations

Viewed:  1855 
Posted On:  23/05/2015 23:54:39 
In this article I am going to explain how to use arithmatic operations in Python... 


 Here I am going to explain how we can perform arithmetic operations in Python. I am going to show addition, subtraction, multiplication & divide here.

Step 1: Open IDLE(Python GUI) in your system.

Step 2 : Type the below code and save the code Eg:- I have saved with name.

a = input("Enter value: ")
b = input("Enter another value : ")

c = float(a) + float(b)
d = float(a) - float(b)
e = float(a) * float(b)
f = float(a) / float(b)

print("sum is ",c)
print("substraction is ",d)
print("multiplication is ",e)
print("division is ",f)

Step 3 :
 Open command prompt.

Step 4 : Go to the saved script folder.

Step 5 : Write python <Script name>.py  for execution.(Eg.- python



Image 1.

         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us