Python Program to add two integers


This content was proof-read by Grammarly. You can Try Grammary for FREE

Problem

Write a program in Python to add two integers and display the result on the screen.

Python Program to add two integers

# Abundantcode.com program to add two integers and display result
num1 = input('Enter first number: ')
num2 = input('Enter second number: ')

result = float(num1) + float(num2)

# Display the sum
print('{0} + {1} = {2}'.format(num1, num2, result))

Output

Enter first number: 1                                                                                                                                                        
Enter second number: 2                                                                                                                                                                  
1 + 2 = 3.0


Are you a .NET Developer planning to integrate GraphQL for .NET in your Application? Check out this book BUY & DOWNLOAD GRAPHQL.NET COOKBOOK
%d bloggers like this: