Results for “python errors”

Showing 21–30 of 55

  1. Article Python Fundamentals

    Python Functions for Beginners

    …required. Forgetting it is probably the most common syntax error in this whole topic. Everything indented under the def line is the body of the function. Python uses that indentation (four spaces is…

  2. Article Mini projects

    Base 6 Number System in Python

    …only): ") if any(d not in "012345" for d in base6): print("Error: base-6 numbers can only contain digits 0-5.") else: result = int(base6, 6) print(f"{base6} (base 6) = {result} in decimal") elif…

  3. Article Python Fundamentals

    Online Python Editor

    …runs exactly as you'd expect, with proper formatting and error messages that actually help. Charts and Graphics? Yes, Really Here's where it gets interesting. Need to test that pandas visualization?…

  4. Challenge

    Entries per level

    Count the mission log's entries per level, INFO, WARN and ERROR, in a dict of counters, then count any level at all with get() when DEBUG lines turn up, and print the levels in alphabetical order.

    Write the code Easy 2 stages dictionaries counting get sorted
  5. Article Mini projects

    Calculate your weight on different planets in Python

    …calculates the weight and displays it. If not, it shows an error message. Let's put it all together. Note that our program calculates weight in Newtons (N), not kilograms (kg). This is because weight…

  6. Article Python Fundamentals

    Nested Loops in Python

    …# ← Overwrites outer x print(x) Python won't throw an error, but you'll get weird results. Always use different names. Mistake 2: Wrong Indentation # Where should this print go? for y in range(3): for…

  7. Challenge

    Launch counter crash

    …launch day, the first launch stopped the program with an error nobody had seen before. Predict what happens, find out why, then fix it in a way that keeps the function independent of the rest of the…

    Fix the code Medium 3 stages functions scope UnboundLocalError global
  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
  9. Challenge

    Log to a file

    …[T+00:12:05] WARN Battery 3 temperature high [T+00:14:47] ERROR Fuel valve 2 not responding The hidden tests also open mission.log and check what is in it. Append without wiping Opening with "w" again…

    Write the code Easy 2 stages files open with write
  10. Challenge

    Signal delay

    …then add the round trip without doubling a rounding error.

    Write the code Medium 3 stages division round // %