Login and get coding
Your task is to complete the
convert()function. It's purpose is to convert centimeters to inches and vice versa. As simple as that sounds, there are some caveats:
- The function will take
value: must be an
floatotherwise raise a
fmt: string containing either
"in"anything else raises a
- returns a
floatrounded to 4 decimal places.
Assume that if the value is being converted into centimeters that the value is in inches and centimeters if it's being converted to inches.
314 out of 319 users completed this Bite.
Will you be Pythonista #315 to crack this Bite?
Resolution time: ~31 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 2.62 on a 1-10 difficulty scale.
» You can do it! 😌