course content

Course Content

Introduction to Python | Mobile-Friendly

ChallengeChallenge
Task

The distance between New York and San Francisco is 4677.4 km (variable dist_km). You need to convert it into miles (by dividing the dist_mi by km_per_mi). Considering that 1 mile equals approximately 1.609 km (variable km_per_mi), save the result in the dist_mi variable, and output the integer part of the distance in miles.

question-icon

Fill in the blanks to complete the task.

# Initial variables
dist_km = 4677.4
km_per_mi = 1.609
# Convert the distance into miles
_ _ _
=
_ _ _
_ _ _
_ _ _

# Output the integer part of dist_mi
print("SF-NY distance in mi:",
_ _ _
(
_ _ _
))
SF-NY distance in mi: 2907

Click or drag`n`drop items and fill in the blanks

dots
dist_mi
dots
/
dots
km_per_mi
dots
float
dots
dist_km
dots
int
dots
dist_km
dots
dist_mi
down-icon

Section 2.

Chapter 9