Computer Science, asked by yasharsh1863, 11 months ago

Write a function that takes amount in dollars and dollars to rupees conversion price it then returns the amount converted into ruppees python

Answers

Answered by franktheruler
24

Answer:

Function to convert dollars to rupees:

def dollars_to_rupees():

       dollar = float(input("Please enter dollars:")) // Input

       rupees = dollars * 64   // conversion logic

       print(rupees, " Rupees")  // print the result

This is a basic function to convert dollars to rupees. Here dollar is a variable name that will store the value which is given by the user.

rupees = dollars * 64 this line shows that, the actual conversion logic.

and lastly, print() function print the final result.

Answered by prakharagrawal6055
6

Answer:

#definition of the function

def dollar_to_rupee(amount,price):

   rs=amount*price

   return rs

#main program

am=float(input("Enter the amount is dollars:"))

pr=float(input("Enter the dollar to rupee conversion price:"))

rupee=dollar_to_rupee(am,pr)

print("Amount converted in rupees is= Rs.",rupee)

Explanation:

Similar questions