🐍 Python 🐍

🍁 Happy November 🍡

View the Project on GitHub riverdaleGithub/intro_python_23

πŸ‘Ύ Are We Alone? πŸ‘Ύ

The left is a photo from the James Webb Space Telescope. Each radiant point you see isn’t just a star – it’s an entire galaxy, each cradling billions of stars within its embrace. When you gaze upon these points of light, you’re not merely observing space but traveling through ⏳ time ⏳, witnessing remnants from the very dawn of our universe. On the right, marvel at the animated brilliance of the James Webb Space Telescope itself, the groundbreaking telescope that is 72 feet by 39.4 feet! How’d they get that into space!?

Second Image

⭐ Fermi Paradox ⭐

The Fermi Paradox addresses the question: why do we seem alone in the universe? Scientists believe there are billions of stars in our galaxy, many of which could harbor Earth-like planets. With the vast number of possibilities, it seems probable that other intelligent life would exist. Yet, the mystery remains: if there are numerous potential alien civilizations, why haven’t we detected any signs of them? Why is the universe so silent?


πŸš€How Far Have Humans Gone Beyound our Solar SystemπŸš€


Lab

The Fermi Paradox describes the contradiction between the high likelihood of extraterrestrial civilizations existing and our absence of evidence or contact with these civilizations. You will first turn the Drake equation into a function, and then you will calculate how many planets should have life on them currently, and describe why we haven’t found life outside our solar system.

The Fermi Paradox describes the contradiction between the high likelihood of extraterrestrial civilizations existing and our absence of evidence or contact with these civilizations.

Consider a model for the Fermi Paradox to simulate varying scenarios:

Turn this Equation Into A function
Run the Drake Equation with these Parameters

πŸ‘©β€πŸ³ Functions & Arguments 🍎πŸ₯¦

ufo

Functions and arguments go hand in hand! 🀝 Think of a function as a chef πŸ‘©β€πŸ³ and arguments as the ingredients. You provide the ingredients to the chef, and she whips up a delightful dish! 🍲

πŸ‘©β€πŸ³ Functions Explained πŸ‘©β€πŸ³ A function operates like a mini-program within your main program. It allows you to bundle code, assign it a name, and utilize it multiple times. Visualize a magic box 🎁 that performs a task every time you invoke it.

def greet():
    print("Hello, world!")
greet()  # This will display "Hello, world!"
🍎πŸ₯¦ Understanding Arguments 🍎πŸ₯¦ Arguments are the special instructions πŸ’Œ you send to your function. Think of them as the specific ingredients 🍎πŸ₯¦ you add to a recipe. The function processes these ingredients to produce a result.

def greet(name):
    print(f"Hello, {name}!")

Scope 🌌

🌍 What is Scope? 🌍 Scope acts as an invisible barrier ⛩️ around segments of your code. Variables (like `x = 5`) exist within these boundaries. Python defines scope with indents (tabs). Imagine you have a toy box 🧸 in your room. Toys inside the box can't be seen or played with by someone in the living room. Similarly, variables inside a function can't be accessed or modified by code outside the function.

def my_function():
    secret_variable = "You can't see me outside the function!"
print(secret_variable)  # This will give an error! 😱
But don't fret! There are ways to share variables between different parts of your code. But that's a tale for another time! πŸ˜‰
How do functions and arguments work together? πŸ€– You invoke functions and supply them with arguments.

def make_sandwich(bread, filling):
    print(f"Here's a {filling} sandwich with {bread} bread!")
make_sandwich("whole grain", "turkey")  # This will print "Here's a turkey sandwich with whole grain bread!"