Results for “random”

7 results

  1. Article Mini projects

    Python Random Module

    …Python programming with space exploration to create a random planet selector. Using Python's random module, you'll learn how to generate exciting space missions while mastering fundamental programming…

  2. Challenge

    Seeded simulation

    …readings, each with a 5% chance of a glitch, and seed random with 42 so the count is the same on every run and a test can check it exactly, then pick a kind for each glitch with random.choice().

    Write the code Easy 2 stages random random.seed random.choice simulation
  3. Article Python Fundamentals

    Nested Loops in Python

    …for rovers that lost contact with base. First we'll randomly place a few rovers, then find them. A more down-to-earth example could involve searching through table results to locate incorrect…

  4. Article Mini projects

    Medical dispenser - Don’t trust the user

    …secret.encode('utf-8') # For demo purposes, generate random secret # In production: use hardware security module or secure key storage secret = os.urandom(32) print("Warning: Using randomly generated…

  5. Article Python Fundamentals

    Python Functions for Beginners

    …name[:3] ) and the .upper() method. Stretch goal: use the random module to add two random digits at the end. 5. Go / no-go check Write is_go_for_launch(fuel, wind_speed, crew_ready) that returns True…

  6. Article Mini projects

    Base 6 Number System in Python

    …Base 6? Beyond the Fiction Andy Weir didn't pick base 6 randomly. The number system a species uses is tied to their anatomy - specifically how many appendages they use for counting. Humans settled on…