The following are exchange rates of US$ to some other currencies.
Currency codes:
Write a Python function which prompts user for keyboard inputs. First prompting for the currency with text From meaning the currency to convert from. Then checks whether it is in correct form:
Then the program queries To, the currency to convert to and again checks for correct currency code. Finally, the program asks for amount. Which should be a decimal number. It then prints out the converted amount and the correct currency as follows.
Example
100US$=128?$100US$=128A$undefinedviaundefined
In [1]:
##functions to check correct inputs
#the function outputs 1 if code is correct 0 otherwise
def check_currency_code(currency):
pass
###############Your Code ins place of "pass"############
def convert_Currency(fromC, toC, amnt):
conv = 0
pass
###############Your Code ins place of "pass"############
In [2]:
##Code template
def currencyConverter():
fromCurrency = input("From")
toCurrency = input("To")
amount = input("Amount")
if (check_currency_code(fromCurrency) and check_currency_code(toCurrency) and check_amount(amnt)):
converted_amnt = convert_currency(fromCurrency, toCurrency, amnt)
print(amnt, 's', fromCurrency, "s=s", )
else:
print("One of the inputs is not in the correct form.")
You are provided with a text file. You will do some basic text processing.
Write a function that gives the following outputs.
Hint. You should try using regex. The built in function str.split() may be useful.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more