Q. Write a function that takes amount-in-dollars and dollar-to-rupee conversion price ; it then returns the amount converted to rupees. Create the function in both void and non-void forms.


You can understand by Watching video :-



Answer :-

Void Function :- Which Function do not return any value.

Non Void :- Which Function return value.

 
def rup(doll) :     #void
    print("(void ) rupees in ",doll ,"dollar = ",doll * 72)

def rupee(doll) :  # non Void
    return doll * 72

doll = float(input("Enter dollar : "))

rup(doll)    #void

print("( non void ) rupees in ",doll ,"dollar = ", rupee(doll) )  # non Void

Output :-

Enter dollar : 1
(void ) rupees in  1.0 dollar =  72.0
( non void ) rupees in  1.0 dollar =  72.0

>>> 

Enter dollar : 63
(void ) rupees in  63.0 dollar =  4536.0
( non void ) rupees in  63.0 dollar =  4536.0

>>> 

Enter dollar : 3214
(void ) rupees in  3214.0 dollar =  231408.0
( non void ) rupees in  3214.0 dollar =  231408.0

>>>

4 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. What is the meaning of void??

    ReplyDelete
    Replies
    1. Function that will not return any value.
      Example :-
      def fun():
      print ("pathwalla")

      Delete
  2. take=int(input('Enter Dollor:'))
    print('In Ruppee :-- ', '₹',take*74.9)

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post