Quiz
Python *args and **kwargs Quiz
…**kwargs in one function Reading keyword arguments with get() and looping over them with items() Unpacking a tuple, a string or a dictionary into a call with * and ** Passing *args and **kwargs on to…
Showing 41–50 of 57
Quiz
…**kwargs in one function Reading keyword arguments with get() and looping over them with items() Unpacking a tuple, a string or a dictionary into a call with * and ** Passing *args and **kwargs on to…
Challenge
…as a character in a string: fields[0] is the first. Lists get a stage of their own later. The value as a number split() gives text, so "412.5" + 273.15 would stop with a TypeError . Turn the value…
Challenge
…tab. That's exactly what happened to \new 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…
Challenge
…line runs. That's a SyntaxError . Find what's missing and get the boot script running again. Missing quote Run the boot script. Instead of booting, it stops with an error: one line is missing its…
Article Python Fundamentals
…it on the screen. Multiple values display Sometimes we get multiple values from one sensor to ensure it's operating correctly. Let's check three measurements taken in a short period: telescope_temp_1…
Article Python Fundamentals
…that reads and executes our code. Here's how to get it: For Windows : Visit the official Python website and download the latest version. Remember to check " Add Python to PATH " during installation…
Challenge
…Check for impossible values first; only a valid longitude gets converted and gets a station.
Challenge
…the fuel budget came out 62.5 kg short. A function that gets a value it can't work with should say so, loudly and clearly, at the moment it happens. Raise ValueError Make fuel_needed() raise…
Challenge
…come from, fix the default, then write a function that gets it right from the start. Predict and run Don't run the code yet. Read it and decide what it will print on its first line. Write your guess…
Challenge
…one number at a time: after each pass the ground station gets a whole list of readings, and every one of them needs the same check. Run the check over the whole list, then add a summary the flight…