Challenge
Safe mode
…name the rule that fired with boolean variables and an if/elif chain.
Showing 11–20 of 23
Challenge
…name the rule that fired with boolean variables and an if/elif chain.
Article Python Fundamentals
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.
Article Mini projects
…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"…
Quiz
…indexing, slicing and string methods Conditions: if , elif , else and truthy values Lists, tuples, dictionaries and sets Loops with range() , break and continue Functions: default values, keyword…
Article Mini projects
…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…
Challenge
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.
Challenge
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…
Challenge
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…
Challenge
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…
Challenge
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…