Results for “lists”

10 results

  1. Article Python Fundamentals

    Nested Loops in Python

    …") # Empty surface print() # New line after each row # List of found rovers print("\n=== FOUND ROVERS REPORT ===\n") for scan_y in range(10): for scan_x in range(10): for x, y, name in lost_rovers: if…

  2. Article Python Fundamentals

    Variables and data types in Python

    …= True engines_active = False Complex Data Types Lists Ordered collections of items, great for storing sequences of data: planet_names = ["Mercury", "Venus", "Earth", "Mars"] temperatures = [167, 464…

  3. Article Mini projects

    Python Random Module

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

  4. Article Mini projects

    Managing Astronaut Medical Data with Python

    …def load_astronauts(self): pass # We'll reload astronauts list here def view_astronauts(self): pass # We'll view a list of astronauts list here def setup_medical_tab(self): pass # We'll add medical…

  5. Article Python Fundamentals

    Python If/Else for Beginners

    …evaluates the value directly: payloads_ready = [] # empty list is falsy if payloads_ready: print("Start deployment.") else: print("No payloads — skip deployment.") Empty lists, empty strings, zero…

  6. Article Python Fundamentals

    Python Books for Beginners

    …first half covers Python fundamentals (variables, lists, dictionaries, functions, classes), while the second half walks you through three complete projects - a Space Invaders-style game, data…

  7. Article Python Fundamentals

    Python Functions for Beginners

    …five, calls get hard to read and easy to get wrong. A long list of parameters is often a sign that the function is trying to do too many jobs. When you really do need several, keyword arguments make…

  8. Article Mini projects

    Calculating Escape Velocity in Python

    …CALCULATION WITH NUMPY") print("="*50) names = list(planets.keys()) masses = np.array([planets[p]["mass"] for p in names]) radii = np.array([planets[p]["radius"] for p in names]) # Calculate all…

  9. Article Python Fundamentals

    Online Python Editor

    …need arguments. Add them with a simple comma-separated list, just like you would in your terminal. No compromises. Built by a Developer Who Gets It I'm not some company trying to sell you a…

  10. Article Mini projects

    Calculate your weight on different planets in Python

    …your weight on: ") We ask for the user's mass and show a list of available planets. The user then chooses a planet. Time to calculate and display the weight: if chosen_planet in planets: gravity =…