Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge | Variables
Introduction to Python | Mobile-Friendly
course content

Kursinnehåll

Introduction to Python | Mobile-Friendly

Introduction to Python | Mobile-Friendly

1. Python Basics
2. Variables
3. Strings

book
Challenge

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

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 9

Fråga AI

expand
ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

course content

Kursinnehåll

Introduction to Python | Mobile-Friendly

Introduction to Python | Mobile-Friendly

1. Python Basics
2. Variables
3. Strings

book
Challenge

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

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 9
Vi beklagar att något gick fel. Vad hände?
some-alt