Challenge: Converting Kilometers to Miles
Oppgave
Swipe to start coding
You are traveling from San Francisco to New York. The distance between them is approximately 4677.4 kilometers. You want to calculate the distance in miles.
- Convert the distance from kilometers to miles by dividing
distance_in_kilometers
by 1.609. Store the result in the variabledistance_in_miles
. - Create a variable called
int_distance_in_miles
to store the integer distance in miles. - Convert the value of
distance_in_miles
to an integer and store it in the variableint_distance_in_miles
.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 2. Kapittel 5
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Suggested prompts:
Oppsummer dette kapittelet
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 1.67
Challenge: Converting Kilometers to Miles
Sveip for å vise menyen
Oppgave
Swipe to start coding
You are traveling from San Francisco to New York. The distance between them is approximately 4677.4 kilometers. You want to calculate the distance in miles.
- Convert the distance from kilometers to miles by dividing
distance_in_kilometers
by 1.609. Store the result in the variabledistance_in_miles
. - Create a variable called
int_distance_in_miles
to store the integer distance in miles. - Convert the value of
distance_in_miles
to an integer and store it in the variableint_distance_in_miles
.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Awesome!
Completion rate improved to 1.67Seksjon 2. Kapittel 5
single