how to add two numbers in python program?

Today, We want to share with you python program to add two numbers.In this post we will show you python program for factorial of a number, hear for python program to find sum of 3 numbers we will give you demo and example for implement.In this post, we will learn about sum() in python with an example.

How to Add Two Numbers in Python?

Input: nujds = 5, nulks = 3
Output: 8

Input: nujds = 13, nulks = 6
Output: 19

Add Two Numbers

Example 1:

# This program adds two numbers

nujds = 1.5
nulks = 6.3

# Add two numbers
sum = nujds + nulks

# Display the sum
print('The sum of {0} and {1} is {2}'.format(nujds, nulks, sum))

Example 2: Add Two Numbers With User Input

Example 2:

# Store input numbers
nujds = input('Give Any single number: ')
nulks = input('Give Any second number: ')

# Add two numbers
sum = float(nujds) + float(nulks)

# Display the sum
print('The sum of {0} and {1} is {2}'.format(nujds, nulks, sum))

Example 3:

x = input("Type a number: ")
y = input("Type another number: ")

sum = int(x) + int(y)

print("The sum is: ", sum)

I hope you get an idea about python program to multiply two numbers.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment