Results for “local variables”

Showing 1–10 of 12

  1. Challenge

    Shadowed fuel

    refuel() 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…

    Fix the code Medium 3 stages functions scope local variables global variables
  2. Article Mini projects

    Medical dispenser - Don’t trust the user

    …secret. Set MEDICATION_DISPENSER_SECRET environment variable for production.") return secret def _compute_hmac(self, message): """Compute HMAC-SHA256 of message using device secret""" return hmac.new(…

  3. 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…