Article Python Fundamentals
Online Python Editor
…your browser tab. Terminal Experience, Browser Convenience Get real terminal-style output without SSH or complex setups. Your code runs exactly as you'd expect, with proper formatting and error…
Showing 31–40 of 57
Article Python Fundamentals
…your browser tab. Terminal Experience, Browser Convenience Get real terminal-style output without SSH or complex setups. Your code runs exactly as you'd expect, with proper formatting and error…
Challenge
Commands to the spacecraft don't always get through the first time: the radio can time out or lose the carrier. The uplink software tries again, but only a few times, so that a dead link doesn't block…
Challenge
…manifest needs whole kilograms, and there are two ways to get rid of the decimals: int() and round() . Most of the time they agree. When they don't, a crate can end up a kilogram lighter on paper than…
Article Mini projects
…decimal_number while number > 0: remainder = number % 6 # Get the last base-6 digit digits.append(str(remainder)) number = number // 6 # Remove that digit # Remainders come out in reverse order, so we…
Article Python Fundamentals
…another loop. Sounds straightforward, but a lot of people get confused here. We use them when we need to go through multidimensional data - Excel tables, scanning a planet's surface point by point…
Article Python Fundamentals
…Edition - Eric Matthes If you're looking for a book that gets you writing actual Python code quickly, this is it. Matthes doesn't waste time with excessive theory - you'll be coding from chapter one…
Article Mini projects
…mass * gravity This function multiplies mass by gravity to get weight. Now, let's get input from the user: mass = float(input("Enter your mass in kg: ")) print("Available planets:") for planet in…
Challenge
…. Make it ask again instead, for as long as it takes to get a usable number. Ask until it's a number Keep asking until the input converts to a number. For anything that doesn't, print Not a number…
Challenge
…too, and copying the loop into each of them is how bugs get fixed in one place and not the other. Turn the parsing into a function that any program can call, then let it decide on its own which lines…
Challenge
…arrived, it sends it again. Mission Control would rather get an event twice than not at all, but the event board must show each one once. Drop the repeated events, then report which ones were…