Python Program To Sum Two Numbers

Python Program To Sum Of Two Numbers

Add two is a very basic level and simple program. In this tutorial, we will learn different methods to add two numbers using python programming.

Method-01

This is a simple arithmetic addition concept to add two numbers.

Num1 = float(input("Enter Number: "))
Num2 = float(input("Enter Number: "))

print('Sum is: {0}'.format(Num1+Num2))

Output:

Enter Number: 45
Enter Number: 54
Sum is: 99.0

 

Method-02

When the input is given in list format.

list01 =[54,45] 

print('Sum is: ',(list01[0]+list01[1]))

Output:

Sum is: 99.0

 

Leave a comment