- #Using Map function to convert F to C
- def map(value, fromLow, fromHigh, toLow, toHigh):
- fromRange = fromHigh - fromLow
- toRange = toHigh - toLow
- scaleFactor = toRange / fromRange
- tmpValue = value - fromLow
- tmpValue *= scaleFactor
- return tmpValue + toLow
- for tempF in range(-100,220,2):
- tempC=map(tempF,32,212,0,100)
- print(F"F={tempF} tempC={tempC}")
Map Function
Posted by Anonymous on Tue 18th Feb 2020 17:29
raw | new post
view followups (newest first): Map Function c22 s2c by Anonymous
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.