Results for “if”

Showing 41–50 of 100

  1. Challenge

    Airlock permissions

    …that the crew member holds every permission in needed . If not, print what is missing, sorted: Kowalska can't depressurise the airlock: missing eva_certified needed <= granted is True when every item…

    Write the code Medium 2 stages sets subset difference permissions
  2. Challenge

    Countdown with holds

    …and end the countdown there, even at a second with a hold. If it reaches the end, print Liftoff! : T-10 T-9 T-8 T-7 HOLD at T-7 T-6 T-5 T-4 T-3 HOLD at T-3 T-2 T-1 T-0 Liftoff! With scrub_at = 4 , the…

    Write the code Easy 2 stages for loop range negative step in
  3. Challenge

    Never-ending wait

    …. Then work out how many "waiting" lines there would be if second went up by 1 each time, and store it in waiting_lines . Remove any lines you added before you check. Modify. Make the loop move on to…

    Fix the code Easy 3 stages while loop infinite loop counter and
  4. Article Mini projects

    Converting Temperatures in Python

    …or inform the user that they entered an incorrect value. if choice == 1: celsius = float(input("Enter the temperature in degrees Celsius: ")) kelvin = celsius_to_kelvin(celsius) print(f"The…

  5. Challenge

    Legacy script

    A 70-line engine report repeats the same twelve lines for each engine. Restructure it into parse_feed() and summary_line() with the output unchanged to the character, then add assert tests that would…

    Fix the code Hard 2 stages project refactoring functions testing
  6. Challenge

    Undo and history

    Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.

    Write the code Hard 2 stages project lists stack append
  7. Challenge

    Silent branch

    status_light() returns None for Scrub because that branch sets a variable but never returns it. Predict the last line, find which statuses give None, make every path return, then write a function…

    Fix the code Easy 3 stages functions return None branches
  8. Challenge

    Unit converter

    Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…

    Write the code Medium 2 stages project dictionaries tuples as keys functions