Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Converting Kilometers to Miles | Variables and Types in Python
Introduction to Python
course content

Contenuti del Corso

Introduction to Python

Introduction to Python

1. First Acquaintance with Python
2. Variables and Types in Python
3. Conditional Statements in Python
4. Other Data Types in Python
5. Loops in Python
6. Functions in Python

book
Challenge: Converting Kilometers to Miles

Compito

Swipe to start coding

The road distance between San Francisco and New York is approximately 4677.4 km. This distance is stored in the variable distance_in_kilometers.

Here's what you need to do:

  • Convert the distance from kilometers (distance_in_kilometers) to miles by dividing it by 1.609. Store the result in the variable distance_in_miles.
  • Create a variable int_distance_in_miles.
  • Convert the variable distance_in_miles to an integer data type.
  • Store the value of distance_in_miles as an integer in the variable int_distance_in_miles.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 5
toggle bottom row

book
Challenge: Converting Kilometers to Miles

Compito

Swipe to start coding

The road distance between San Francisco and New York is approximately 4677.4 km. This distance is stored in the variable distance_in_kilometers.

Here's what you need to do:

  • Convert the distance from kilometers (distance_in_kilometers) to miles by dividing it by 1.609. Store the result in the variable distance_in_miles.
  • Create a variable int_distance_in_miles.
  • Convert the variable distance_in_miles to an integer data type.
  • Store the value of distance_in_miles as an integer in the variable int_distance_in_miles.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 5
Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Siamo spiacenti che qualcosa sia andato storto. Cosa è successo?
some-alt