Python Program to Add Two Numbers, User Defined

Topic: Add Two Numbers

Hey Guys, today we are going see a Python Program on how to add two Number

Title: Python Code Sum of Two Numbers (Beginner Friendly+ Easy + Code + Output + Online Compiler)


What is this program and why we are going to use it?

This Program consists of Variables & Input Function.
By using variable, we are going to store two values in two different Variables in int or float format according to your use. By using input function, we are going to input the values by user. For Eg. storing the values:
a=5
b=6
here a and b are variables where 5 is assigned to a and 6 is assigned to b. 

Now for input fucntion

a= int(input("Enter Num a:"))
So, this will ask user to input a number. 

Code:


Online Compiler (Switch to Interactive Mode before execution):



Applications:
1. Basic Arithmetic Operation code.
2. Increase the Reliability of the code for example: Asking the user to input some value like some number, name, age etc. As the user who not written the code can know about the input. 
3. Real World applications where we need to add multiple numbers in larger codes. For example, for a data of 1000 students we can solve the calculations for results generation all easily.

Comments