ACTIVITY 12 / 50
Try as many times as you needDistance converter
Let’s understand
A computer can convert measurements. One kilometre contains one thousand metres. Multiply a distance in kilometres by 1000 to get metres. input returns text; float converts a number with a decimal point so you can calculate with it. Test a whole distance and half a kilometre.
Listen to the explanation
Example
hours = 1.5
print(hours * 60)Read kilometres using float(input()). Print metres. For input 1.5, output 1500.0.
I need a hint
Multiply the input by 1000. Print only the number.
How to find an error
- Read the last line of the error message.
- Find the indicated line. Check quotes, parentheses and indentation.
- Change one thing and run again.
main.py
4 spaces
Your draft stays in this browser.
Result
PythonYour program’s output will appear here. Click Run.
Мой профиль