Python Create Function Called Td X Y Takes Two Parameters Value Determine Value Larger Cal Q37114605

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.