Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.77 KB | None | 0 0
  1. # improved version of the currency converter ;D
  2. try:
  3.     print(" Euro == 1 \n Pound == 2 \n Dollar == 3")
  4.     an = (1, 2, 3)
  5.     user_amount = int(input("What's the currency you want sire? : "))
  6.     user_input = int(input("How much of that currency you want to convert? :  "))
  7.     print(" Euro == 1 \n Pound == 2 \n Dollar == 3")
  8.     convert_input = int(input("Whats the currency you want to convert it to, sire? : "))
  9.     if user_amount or convert_input == an:
  10.         exit("sorry it seems you entered invalid numbers in the lines above. Make sure you enter \'1, 2 or 3\' as your answers for the questions above")
  11. except ValueError:
  12.     exit("RIP you didn't enter a number, soz mate")
  13. de = ("Your total number is:   " + str(user_input / 1.11))
  14. pd = ("Your total number is:   " + str(user_input * 1.21))
  15. dp = ("Your total number is:   " + str(user_input / 1.21))
  16. pe = ("Your total number is:   " + str(user_input * 1.09))
  17. ep = ("Your total number is:   " + str(user_input / 1.09))
  18. ed = ("Your total number is:   " + str(user_input * 1.11))
  19. ee = ("Your total number is:   " + str(user_input * 1))
  20. dd = ("Your total number is:   " + str(user_input * 1))
  21. pp = ("Your total number is:   " + str(user_input * 1))
  22. if user_amount == 1 and convert_input == 1:
  23.     print(ee)
  24. elif user_amount == 1 and convert_input == 2:
  25.     print(ep)
  26. elif user_amount == 1 and convert_input == 3:
  27.     print(ed)
  28. elif user_amount == 2 and convert_input == 1:
  29.     print(pe)
  30. elif user_amount == 2 and convert_input == 2:
  31.     print(pp)
  32. if user_amount == 2 and convert_input == 3:
  33.     print(pd)
  34. if user_amount == 3 and convert_input == 1:
  35.     print(de)
  36. if user_amount == 3 and convert_input == 2:
  37.     print(dp)
  38. if user_amount == 3 and convert_input == 3:
  39.     print(dd)
  40. exit("Program finished operating")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement