Challenge
Real JSON
…is text, and the program stops with TypeError: string indices must be integers . Turn the text into a dict with json.loads() , then add a line for crewed : Launch: Lumen-3 Provider: JAXA Status: Go…
Showing 41–50 of 65
Challenge
…is text, and the program stops with TypeError: string indices must be integers . Turn the text into a dict with json.loads() , then add a line for crewed : Launch: Lumen-3 Provider: JAXA Status: Go…
Article Mini projects
…column=0, padx=5, pady=5) self.astronaut_var = tk.StringVar() self.astronaut_dropdown = ttk.Combobox(self.medical_frame, textvariable=self.astronaut_var) self.astronaut_dropdown.grid(row=0, column=1…
Challenge
…csv.DictReader Replace the old parser and its feed string: open telemetry.csv with newline="" , loop over csv.DictReader(csv_file) , and print each row in the same format as before: 09:30:05 ENG-2…
Example
Changing data types using int(), float() and str() functions. Converting between types.
Quiz
…on the topics of the earlier quizzes, from variables and strings to lists, dictionaries and functions. For each piece of code you decide which error it raises, read the message, or choose the fix…
Challenge
…member: Kowalska Crew size: 4 Indexes start at 0, as in strings. crew[-1] is the last item whatever the list's length, and len(crew) counts the items. The whole roster Add the second in command, who…
Challenge
…at the end. A negative start counts from the end, as with strings. The window moves A new reading has arrived. Add new_reading = 772 under the list, append it to the readings, then show the new window…
Quiz
…one, try the Python Math Operations Quiz or the Python Strings Quiz . What does this code print? What does this code print? Given status = "ready" , which of these lines run without an error? What…
Article Python Fundamentals
…print("No payloads — skip deployment.") Empty lists, empty strings, zero, and None all evaluate to False . Pretty much everything else is True . Nesting: decisions within decisions You can nest if…
Example
For loop iterates through sequence elements. Basic iteration over lists.