Results for “elif”

Showing 11–20 of 23

  1. Challenge

    Safe mode

    …name the rule that fired with boolean variables and an if/elif chain.

    Write the code Medium 2 stages if elif or and
  2. Article Python Fundamentals

    Python If/Else for Beginners

    Learn Python if, elif, and else with clear, space-themed examples and hands-on exercises. Perfect for beginners who want to chart the control flow of their programs.

  3. Article Mini projects

    Calculating Escape Velocity in Python

    …choice: ") if choice == "0": print("\nGoodbye! ?") break elif choice in planets_db: planet = planets_db[choice] display_results(planet["name"], planet["mass"], planet["radius"]) elif choice == "10"…

  4. Article Mini projects

    Converting Temperatures in Python

    …temperature in degrees Kelvin is: {kelvin:.2f} K") elif choice == 2: fahrenheit = float(input("Enter the temperature in degrees Fahrenheit: ")) kelvin = fahrenheit_to_kelvin(fahrenheit) print(f"The…

  5. 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
  6. Challenge

    Manifest validator

    Write problems(item), which lists everything wrong with one cargo item: missing fields, a mass that isn't a number, is 0 or is over the limit. Print a pass or fail line per item, then catch duplicate…

    Write the code Medium 2 stages project validation dictionaries functions
  7. Challenge

    Logging instead of print

    The tank check is full of prints left over from debugging. Replace them with logging calls at the right levels, so debug records stay hidden until switched on, then give the fuel code its own named…

    Fix the code Medium 2 stages logging debug info warning
  8. Challenge

    Missing reading

    Extend the alert check from "Alert level" so a sensor that didn't answer, None, prints NO DATA instead of crashing, without treating a real 0 as missing, then do the same for an empty field in a…

    Write the code Medium 2 stages if else None is None
  9. Challenge

    Telemetry pipeline

    A small but complete data pipeline: read the telemetry CSV, reject rows with unknown sensors or broken values and say why, flag readings outside each sensor's limits, and save a JSON summary for the…

    Write the code Hard 3 stages project csv json files