Currency Converter from USD to PKR and vice versa in Python


print("Welcome to Currency Converter!")
print("A- USD to PKR")
print("B- PKR to USD")

choice = input("Plz enter your choice: ").lower()

if choice == "a":
      dollars = float(input("Plz enter the amount of dollars: "))
      pkr = dollars * 261.17
      print(f"{dollars} dollar(s) is equal to {round((pkr), 2)} Pakistani Rupees!")
      
elif choice == "b":
      pkr = float(input("Plz enter the amount of rupees: "))
      dollars = pkr / 261.17
      print(f"{pkr} Rupee(s) is equal to {round((dollars), 2)} US dollars!")
      
else:
      print("invalid input.")

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes