Challenge
Any number of values
…pass: 419.5 Inside the function, values is a tuple, so sum() and len() work on it. In the second call, average(*readings) passes the five readings as five separate arguments. An option after the…
Showing 11–20 of 21
Challenge
…pass: 419.5 Inside the function, values is a tuple, so sum() and len() work on it. In the second call, average(*readings) passes the five readings as five separate arguments. An option after the…
Challenge
…+ "1" gives when you type 4, and store it as text in text_sum . Run print(crew + "1") to check, and remove that line before you check. Modify. Fix the program with int() , so that for 4 it prints…
Challenge
The summary on the engine dashboard uses a small mean() function. It works on the usual lists. Nobody has tried it on an empty pass, a pass with one reading, or the cryogenic sensors, whose readings…
Challenge
…variable holding the text "Esrange" and put it into the summary, so the program prints: Perseid: crew 4, fuel 12.5 t, from Esrange, dry run True Make: Rover config Now write a config yourself. Store…
Challenge
Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.
Example
Parameters can have default values. Used when argument is not provided.
Challenge
…gives the categories ordered by their totals. sum(totals.values()) is the whole load.
Quiz
…pop() and remove() sort() vs sorted() , min() , max() and sum() Copying a list, and lists inside lists How it works 15 questions: 11 with one correct answer, 4 where you select every correct answer…
Article Mini projects
…digit, with carrying. Remember - you carry when a column sum reaches 6 or more, not 10. This is how Rocky probably learned arithmetic in Eridian school. Good luck, cadets. And remember - if you ever…
Article Python Fundamentals
…based on temperature ranges: < -100 , -100..50 , > 50 . Summary Conditional statements are how your programs make decisions. Start with simple if/else blocks, add elif when you need more branches, and…