Results for “clean code”

Showing 1–10 of 22

  1. Challenge

    Magic numbers

    …One 's lander works out the weight of each part. The code is correct, but it's full of bare numbers like 9.81 and 1000 . Programmers call them magic numbers : they work, but nobody reading the code…

    Fix the code Easy 3 stages constants refactoring variables clean code
  2. Challenge

    Flatten nested ifs

    …written out three times. Every new rule would push the code further to the right. Flatten it into one condition without changing what it prints, then rewrite it so a HOLD says which check failed. One…

    Fix the code Medium 2 stages if elif and nested conditions
  3. Article Python Fundamentals

    Nested Loops in Python

    …Learn how they work, avoid common pitfalls, and write cleaner Python code with real examples.

  4. Article Python Fundamentals

    Online Python Editor

    Run Python code on your phone with real pandas, matplotlib & Pillow support. Online editor with mobile-friendly interface, CLI arguments & terminal output. No sign-up required.

  5. Challenge

    Shared default list

    Each sampling run should start a clean log. The morning run did. The evening run started with the morning's sample already in it, and by the end of the week every new log held every sample ever taken…

    Fix the code Medium 3 stages functions default values mutable defaults None
  6. Challenge

    Changed the caller's list

    …that leaves its input alone. Predict and run Don't run the code yet. Read it and decide what it will print on its first line. Write your guess in prediction , at the top, between the quotes. Then run…

    Fix the code Medium 3 stages functions lists mutation return