Challenge
Date and time from a timestamp
…of day out of it, then show them the way the ground team writes dates. Date and time Slice the date and the time of day out of the timestamp and print them: Date: 2026-03-14 Time: 09:30:05 The date is…
Showing 61–70 of 95
Challenge
…of day out of it, then show them the way the ground team writes dates. Date and time Slice the date and the time of day out of the timestamp and print them: Date: 2026-03-14 Time: 09:30:05 The date is…
Article Python Fundamentals
…condition types Here's what you'll use most often when writing conditions: Comparisons: == , != , < , > , <= , >= Logical operators: and , or , not Membership: in , not in Truthiness: values like 0…
Challenge
Every mission has one: the script written the night before launch that everybody still runs and nobody dares to touch. This one prints the daily engine report. It repeats the same twelve lines for…
Challenge
…5, timeout: 5.0 s) ABORT (retries: 3, timeout: 1.0 s) Write the defaults in the def line: def send_command(cmd, retries=3, timeout=5.0): . The calls stay as they are. A new option Abort commands need…
Challenge
…then the format has been copied into every program that writes to the log, and each copy has drifted a little. Put the format in one function that returns the line, then see what happens when the…
Challenge
…Kestrel-7 2026-12-01 Tern-5 2027-01-18 Polaris Cargo 4 Write launch_date(launch) , which returns launch["date"] , and pass it to sorted(launches, key=launch_date) , without brackets after its name…
Challenge
…longitude, then make the scheduler cope with longitudes written the other common way. Three bands Each station covers a band of longitudes. Pick the one the spacecraft is over and print it: from 60 to…
Challenge
Every system on Python One writes to the mission log, one line per event. Engineers search those logs, tools filter them by level, and alarms go off when an ERROR line appears. That only works if…
Challenge
…and \telemetry . Get the paths to print the way Windows writes them. Raw string Run the script and look at the output: the path is split across two lines, with a strange gap in the middle. Fix the…
Article Mini projects
…How to make these conversions in Python? Before we start writing code, we need to determine what information we'll need from the program user: Which temperature they want to convert: Celsius or…