Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added functions/__pycache__/currency-calc.cpython-38.pyc
Binary file not shown.
30 changes: 30 additions & 0 deletions functions/currency-calc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from forex_python.converter import CurrencyRates
def calc(should_print=False):

print("""
Name:Currency Calculator
Operation : cuurency calculation
Inputs : a->string,b->string,x->int/float
Outputs: y=>conversion of currency ->float
Author : Apoorva-Datir
\n
""")


c = CurrencyRates()
a=input("enter original currency(e.g. USD): ")
b=input("enter second currency(e.g. INR): ")
x= float(input("enter amount: "))
y=c.convert(a, b, x)
print("{} {} = {} {}".format(x,a,y,b))



result = {}
result['inputs'] = [a, b, x]
result['outputs'] = [y]

if should_print:
print(f"Solution {result['outputs'][0]}")
else:
return result