In this lesson we explore the most useful functions in the Python random library, including randint, randrange, and choice. We'll use what we learn to randomly sparkle a CircuitPlayground using CircuitPython, and we'll then learn to use a while loop to prevent any values from being repeated. We'll end by showing how you can use the code you've just written to create a holiday ornament by adding just a few more low-cost parts.
Part of Prof. John Gallaugher's STEMEducation curricula in his University Course: Physical Computing: Art, Robotics, and Tech for Good. For full playlist see: bit.ly/circuit...
8 сен 2024