Results for “python variables”

Showing 31–40 of 53

  1. 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(…

  2. Article Python Fundamentals

    A Practical Guide to Getting Started with Programming

    …need: Basic arithmetic Simple algebra (understanding variables) Logic skills (if this, then that) Problem-solving ability How do I learn math for programming? While basic math skills are helpful, you…

  3. Challenge

    Alert level

    …check the exact boundaries, then store the level in a variable for a status line.

    Write the code Easy 2 stages if elif else comparisons
  4. Challenge

    Silent branch

    …returns None for Scrub because that branch sets a variable but never returns it. Predict the last line, find which statuses give None, make every path return, then write a function where every path…

    Fix the code Easy 3 stages functions return None branches
  5. Challenge

    Unit mix-up

    …thousands. Investigate and modify Investigate. Find the variable that holds a distance in a different unit and store its name, as text, in odd_one_out . Then convert it: one mile is 1.609344 km. Store…

    Fix the code Easy 3 stages units conversion constants debugging