Python: create a function called td (x,y) whichtakes two parameters of any value
Determine which value is larger and calculate itstruncating division by the small number. You areNOT allowed to use truncating division (//)operator (For example, if the parameters are 5.4 and 49;modulo is 5.0. Or if the numbers are 18 and 9; modulo is 2).
def td(x,y):
if x>y:
answer=
if x<y:
answer=
return answer
I know I am supposed to use a formula to calculatetruncating division without using (//), but I am not sure what itis, can someone help?
Solution
def td(x, y): if x > y:
OR
OR