Results for “for”

Showing 1–10 of 202

  1. Challenge

    Fuel for a burn

    Ask for an engine burn length with input(), turn it into a number with float() and work out the propellant it uses, then read the tank level too and show what the burn leaves.

    Write the code Easy 2 stages input float type conversion multiplication
  2. Challenge

    Log line format

    …prints 12 , but {seconds} prints 5 , not 05 . Add a format spec after a colon: {seconds:02} means "at least 2 characters wide, filled with zeros".

    Write the code Easy 2 stages f-strings print logs formatting
  3. Article Python Fundamentals

    Python If/Else for Beginners

    …space-themed examples and hands-on exercises. Perfect for beginners who want to chart the control flow of their programs.

  4. Article Python Fundamentals

    Python Books for Beginners

    …and these two books consistently deliver results - though for very different reasons. Let's see which learning style matches yours.

  5. Challenge

    Log formatter function

    Move the mission log's f-string into format_log(t, level, msg), a function that returns the line instead of printing it, then fix the alignment of every log line with one change inside the function.

    Fix the code Easy 2 stages functions def return refactoring
  6. Challenge

    One orbit short

    …is ten orbits long, and the flight log should have a line for each one. The log always ends one orbit early, and the last orbit, the one that matters for the landing, is never in it. Predict the last…

    Fix the code Easy 3 stages for loop range off-by-one step