Q. Given below is semi-complete code of module basic.py:
#
"""___________"""
def square (x):
"""_________"""
return mul(x, x):
___mul(x,y) :
"""___________"""
return x*y
def div(x, y) :
"""________"""
return float(x)/y
____def fdiv(x, y)____
"""_______"""
________x//y
def floordiv(x, y)____
_______fdiv(x,y)
Complete the code. Save as a module
Answer =
"""Module :- basic.py""" def square(x): """Square of a given number""" return mul(x, x) def mul (x,y) : """Multiplication of given numbers""" return x*y def div(x, y) : """Division of given numbers""" return float(x)/y def fdiv(x, y): """Floor division of given numbers""" return x//y def floordiv(x, y) : return fdiv(x,y)
Output :-
>>> square(8)
64
>>> mul (2,4)
8
>>> div(58,2)
29.0
>>> fdiv(49,2)
24
>>> floordiv(25,3)
8
>>>
without giving print statement how will you give the output and how it will print
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )