Python simple function definitions and usage examples

From , 2 Years ago, written in Python, viewed 229 times.
URL https://pastebin.vip/view/80a9efd3
  1. def convertTemp(temp, scale):
  2.    if scale == "c":
  3.       return (temp - 32.0) * (5.0/9.0)
  4.    elif scale == "f":
  5.       return temp * 9.0/5.0 + 32
  6.  
  7. temp = int(input("Enter a temperature: "))
  8. scale = input("Enter the scale to convert to: ")
  9. converted = convertTemp(temp, scale)
  10. print("The converted temp is: " + str(converted))
  11. #//python/7396

Reply to "Python simple function definitions and usage examples"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website