Skip to main content

Python program to add two numbers


Python program to add two numbers


Given- two numbers num1 and num2. The task is to write a Python program to find the addition of these two numbers.
Examples:
Input: num1 = 5, num2 = 3
Output: 8

Input: num1 = 13, num2 = 6
Output: 19
In the below program to add two numbers, the user is first asked to enter two numbers and the input is scanned using the input() function and stored in the variables number1 and number2. Then, the variables number1 and number2 are added using the arithmetic operator + and the result is stored in the variable sum.
Below is the Python program to add two numbers:
Example 1:
# Python3 program to add two numbers
  
num1 = 15
num2 = 12
  
# Adding two nos
sum = num1 + num2
  
# printing values
print("Sum of {0} and {1} is {2}" .format(num1, num2, sum))
Output:
Sum of 15 and 12 is 27

Popular posts from this blog

Sudo - SuperUser Access TERMUX

Sudo works on only rooted devices   sudo means superuser & root command we can run root tools in termux using sudo Execute these commands one by one to install sudo. Installation : $ apt update  $ apt upgrade $ apt install git $ apt install tsu $ apt install ncurses-utils $ git clone https://github.com/termux-sudo $ cd termux-sud $ cat sudo > /data/data/com.termux/files/usr/bin/sudo $ chmod 700 /data/data/com.termux/files/usr/bin/sudo sudo su sudo tsu Now you are a root user..

Termux Login Script

Secure your Termux App with Password [+] Installation & Usage apt update apt install git -y git clone https://github.com/htr-tech/termux-login.git cd termux-login chmod +x * sh install.sh exit  or use Single Command apt update && apt install git -y && git clone https://github.com/htr-tech/termux-login.git && cd termux-login && chmod +x * && sh install.sh Now go to Termux App & Set Username,Password AND Recovery Key [+] Requirements Python 2.x [+] Features : • Bug Fixed • Parrot typing Shell Added CREDITS : https://github.com/Udoy2/  https://github.com/TechnicalMujeeb/  [+] Find Me on : Instagram : @tahmid.rayat Facebook : tahmid.rayat.official Github : htr-tech

Creating a .zip file using TERMUX

Creating a .zip file using TERMUX or Kali Linux Fisrt update and install requirments .. $ apt update $ apt upgrade $ apt install zip $ apt install unzip ** Creating Zip file : $ zip name.zip [your files] Here name.zip is the name for that zip file **Unzip process : $ unzip name.zip that's it it will unzip your zip file.. Enjoy... All  Copyright  Are  Reserved ©