Results for “python variables”

Showing 11–20 of 53

  1. Challenge

    Shadowed fuel

    …assigns to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write a…

    Fix the code Medium 3 stages functions scope local variables global variables
  2. Challenge

    Manifest line

    Unpack an (id, item, mass_kg) tuple into three named variables and print a cargo manifest line, then fix the ValueError when the manifest adds a fourth field.

    Write the code Easy 2 stages tuples unpacking ValueError formatting
  3. Challenge

    Magic numbers

    Turn the bare 9.81 and 1000 in a weight report into named constants without changing the output, then write a Mars version with constants from the start.

    Fix the code Easy 3 stages constants refactoring variables clean code
  4. Article Python Fundamentals

    Python Functions for Beginners

    …greet_crew is the name. The rules are the same as for variable names: lowercase letters, words joined with underscores, no spaces, and it can't start with a number. The parentheses () are where inputs…