Python Subtraction

Description

Python program to get two integer numbers, subract both the integers and dispaly the difference
Sample Input 1:
6
5
Sample Sample Output 1:
-1
Input2:
65 4
Output2:
61

Solution

num1=int(input("Enter First number:"))
num2=int(input("Enter second number:"))
diff=num1-num2
print(diff)

Explanation

Read two inputs using input() method.
Conver it into integer by int() method.
Subtract it using - operator.



Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution