From 678e71098ee9aecdcb03eb0626a92b4eec5c0e9b Mon Sep 17 00:00:00 2001 From: LavanyaIG <96461042+LavanyaIG@users.noreply.github.com> Date: Tue, 21 Dec 2021 14:27:36 +0530 Subject: [PATCH] modulus If we enter 2 numbers modulus of number will be entered as a output --- modulus .py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modulus .py diff --git a/modulus .py b/modulus .py new file mode 100644 index 0000000..541914d --- /dev/null +++ b/modulus .py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[10]: + + +while True:# If the while condition is true if block is executed + a=input("Do you want to continue or not(y/n)?") + if a.upper()=='Y':# if the user pass 'Y' the following statement is executed + break +a=int(input('FIRst number is:')) #first number +b=int(input('second number is:')) #second number +print(a,"%",b,"=",a%b)# perform a % b +print(b,"%",a,"=",b%a) # perform b % a + + +# In[ ]: + + + +