Python Modulus

Python program to get two integer numbers, divide both the integers and display the remainder.

Sample Input 1:

6 5

Sample Output 1:

1

Sample Input 2:

28 4

Sample Output 2:

 0

Try your Solution

Strongly recommended to Solve it on your own, Don't directly go to the solution given below.

#write your code here

Program or Solution

				
			
					
num1=int(input("Enter First number:"))
num2=int(input("Enter second number:"))
remainder=num1%num2
print(remainder)

			
				
			

Program Explanation

Read two inputs using input() method.

Convert it into integer by int() method.

Add it using + operator.

Comments