Results for “get”

Showing 11–20 of 57

  1. Article Mini projects

    Calculating Escape Velocity in Python

    …custom parameters") print(" 0. Exit") print("-"*50) def get_custom_parameters(): """Gets parameters from user.""" print("\nENTER CELESTIAL BODY DATA") name = input("Name: ") while True: try: mass_str…

  2. Challenge

    Numbered checklist

    …3. Arm the abort system 4. Switch to internal power 5. Get a go from Mission Control enumerate(checklist, start=1) gives pairs of a number and an item. Unpack them in the loop: for number, item in…

    Write the code Easy 2 stages for loop enumerate start lists
  3. Challenge

    Mission elapsed time

    …timestamp with datetime.fromisoformat(), subtract them to get the mission elapsed time, then time events reported by ground stations in three different time zones.

    Write the code Medium 2 stages datetime timedelta ISO 8601 time zones
  4. Challenge

    Never-ending wait

    …the planet, the receiver waits for the antenna signal to get strong enough to lock on. The waiting code should print a line each second and then report the lock. Instead, the ground station screen…

    Fix the code Easy 3 stages while loop infinite loop counter and
  5. Article Mini projects

    Python Random Module

    …planet destination = random.choice(list(planets.keys())) # Get planet details planet_info = planets[destination] return destination, planet_info # Let's try our space lottery! planet, details =…

  6. Challenge

    Index by ID

    …ID. Answer each one from the index; an ID that isn't in it gets a message instead of a KeyError : CG-0044 | Freeze-dried meals | food | 42.0 kg CG-0099: not on the manifest CG-0042 | Water filter…

    Write the code Medium 2 stages dictionaries indexing lookup in
  7. Challenge

    Prints instead of returns

    …prints its result instead of returning it, so the caller gets None. Predict the last line, find out what the function gives back, fix it with return, then write a conversion function that returns.

    Fix the code Easy 3 stages functions return print None