Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def KmtoMil():
- chi = int(input(" [1] KMH to MPH\n [2] MPH to KMH\n >> "))
- if chi == 1:
- inp = int(input("Enter kmh: "))
- mph = 0.6214 * inp
- print ("Speed: {0} MPH >> {1:.2f} Km/H".format(inp, mph))
- elif chi == 2:
- inp = int(input("Enter mph: "))
- kmh = inp / 0.6214
- print ("Speed: {0} Km/H >> {1:.2f} MPH".format(inp, kmh))
- else :
- print("You must enter 1 or 2")
- #-------------------------------------------------------------------------#
- def CurrExc():
- chi = int(input(" [1] THB to USD\n [2] USD to THB\n >> "))
- if chi == 1:
- inp = int(input("Enter THB: "))
- usd = inp/32.12
- print ("{0} THB equals {1:.2f} USD".format(inp, usd))
- elif chi == 2:
- inp = int(input("Enter USD: "))
- thb = inp * 32.12
- print ("{0} USD equals {1:.2f} THB".format(inp, thb))
- else :
- print("You must enter 1 or 2")
- #-------------------------------------------------------------------------#
- #
- # เรียกใช้ฟังก์ชั่นโดยการพิมพ์ KmToMil()
- #
- #-------------------------------------------------------------------------#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement