Space Python Loading Python…

Basic Math Operations

 
0:00 / 0:00

Challenge

Practise what this example shows with these challenges.

Tank level

Write the codeEasy 2 stages

Turn a tank's capacity and contents into a fill percentage with one decimal place, then draw the crew display's ten-segment gauge with string repetition and int().

Start the challenge

Signal delay

Write the codeMedium 3 stages

Divide a distance by the speed of light to get the radio delay to a Mars orbiter, show it in whole minutes and seconds, then add the round trip without doubling a rounding error.

Start the challenge

Downlink time

Write the codeMedium 3 stages

Read a file size in MB and a link speed in Mbit/s with input(), work out the transfer time without forgetting the 8 bits in a byte, show it in minutes and seconds, then count the ground station passes.

Start the challenge

Unit mix-up

Fix the codeEasy 3 stages

A trajectory total adds a leg in miles to legs in kilometres. Predict the total, find the leg that doesn't fit, convert it with a named constant, then convert a lander's feet per second to metres.

Start the challenge

Discussion

Stuck on this example or want to go further? Ask here, or see what others asked.

Log in to ask and reply.

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].