Challenge
Packing crates
…Crates needed: 9 Tubes in the last crate: 4 Empty slots: 8 Rounding a division up is a classic trick: (tubes + slots_per_crate - 1) // slots_per_crate . Adding one tube less than a full crate pushes…
6 results
Challenge
…Crates needed: 9 Tubes in the last crate: 4 Empty slots: 8 Rounding a division up is a classic trick: (tubes + slots_per_crate - 1) // slots_per_crate . Adding one tube less than a full crate pushes…
Challenge
…gives 2. Predict the difference, investigate Python's rounding rule, then round a fuel reading two ways.
Challenge
Two small top-ups of fuel, 0.1 and 0.2 tonnes, go into the tank. Adding them up should be the easiest calculation on board, and yet Python prints something nobody expects. Predict it, look closely at…
Quiz
…on +, -, *, /, //, %, **, operator precedence and rounding, with instant answers.
Article Python Fundamentals
…call the slot gets whatever you pass in next. People mix up "parameter" and "argument" all the time, including people who've been writing code for years, so don't lose sleep over it. The short…
Challenge
…to the second. Show whole minutes and seconds instead, rounding to the nearest second first. For a 1250 MB file at 6 Mbit/s: Downlink time: 27 min 47 s The same trick as in "Signal delay": round, then…