Challenge
Prints instead of returns
…gives back and store it, as text, in returned . Then print type(engine_k) and store the type's name in value_type . Remove any lines you added before you check. Modify. Make to_kelvin() give its…
Showing 31–40 of 73
Challenge
…gives back and store it, as text, in returned . Then print type(engine_k) and store the type's name in value_type . Remove any lines you added before you check. Modify. Make to_kelvin() give its…
Challenge
…why, compare the text instead, then read yes/no settings typed by hand.
Challenge
…time and datetime.now(timezone.utc) instead of a number typed by hand, then turn it into a countdown() that counts up with T+ after launch.
Challenge
…Change except: to except Exception as error: and print type(error).__name__ in it, to see what is really being caught. Store its name in hidden_error , and the number of readings that are really bad…
Article Mini projects
…{details['distance']} million km") print(f"Surface type: {details['surface']}") print(f"Number of moons to explore: {details['moons']}") print(f"Mission duration: {mission_duration} days")…
Article Mini projects
…menu using the print() function: print("Choose the type of conversion:") print("1. Temperature in degrees Celsius to temperature in degrees Kelvin.") print("2. Temperature in degrees Fahrenheit to…
Challenge
The logistics team typed the manifest for the next supply flight by hand, and the loading crew won't touch a crate until every line checks out. Last time, a typo in a mass sent a 61 kg battery pack to…
Example
Functions can return complex data structures like dictionaries or lists.
Example
Sets store only unique elements without a specific order.
Article Mini projects
…ValueError: messagebox.showerror("Error", "Invalid input types!") return conn = sqlite3.connect('space_station.db') cursor = conn.cursor() cursor.execute("INSERT INTO medical_records (astronaut_id…