Article Mini projects
Calculating Escape Velocity in Python
…to Earth: {ratio:.2f}x") def main(): """Main program loop.""" print("Welcome to the escape velocity calculator!") print("Powered by NumPy for accurate scientific calculations") while True…
Showing 21–30 of 57
Article Mini projects
…to Earth: {ratio:.2f}x") def main(): """Main program loop.""" print("Welcome to the escape velocity calculator!") print("Powered by NumPy for accurate scientific calculations") while True…
Challenge
…each field by key, then add up the masses in the same loop for a total line.
Challenge
A loop over range(1, 10) logs nine orbits of a ten-orbit flight. Predict the last line, find out where range() stops, fix it with ORBITS + 1, then list every third orbit with a range() step.
Challenge
Print each sensor name with its reading by looping over two lists together with zip(), then add a third list of units and warn when the lists don't have the same length, since zip() quietly stops at…
Challenge
…CABIN: 101.2 kPa 09:30:10 ENG-2: 415.0 C At the top of the loop, strip the line, then continue when it's empty or starts with # . Stripping first matters: one comment is indented, and a line can hold…
Challenge
Extend the OK/WARN/CRITICAL check from Alert level so a for loop runs it over every temperature in a list, then count the WARN and CRITICAL readings for a summary line.
Challenge
…line, and a parser has to handle every line the same way. Loop over the lines, split each one, and print what the flight controllers need. Line by line Go through the feed line by line, split each…
Article Python Fundamentals
…shapes and creating simple animations while learning loops and functions, which keeps things visually interesting. The math isn't overwhelming either - basic algebra is enough for most examples. Fair…
Challenge
…ERROR Fuel valve 2 still closed Start with alerts = [] , loop over the log, and append() each line that contains "] WARN" or "] ERROR" . The log itself must stay complete. A minimum level Make the…
Article Python Fundamentals
…answer should be 430. Because return sits inside the for loop, the function ends during the very first pass. Move it back one level so it lines up with for : def total_fuel(tanks): total = 0 for tank…