Log inSign up
Stephen Gruppetta
19.5K posts
Image
user avatar
Stephen Gruppetta
@s_gruppetta
Constantly looking for simple ways to explain complex things You'll find: • Python • Narrative Technical Writing • Track & Field Athletics—Links in pinned post
stephengruppetta.com
Joined October 2019
731
Following
9,359
Followers
RepliesRepliesMediaMedia

New to X?

Sign up now to get your own personalized timeline!

Create account

By signing up, you agree to the Terms of Service and Privacy Policy, including Cookie Use.

Terms·Privacy·Cookies·Accessibility·Ads Info·© 2026 X Corp.
Don't miss what's happening
People on X are the first to know.
Log inSign up
  • Pinned
    user avatar
    Stephen Gruppetta
    @s_gruppetta
    May 19, 2025
    Stuff I do… • Python Python articles thepythoncodingstack.com The Python Coding Book amzn.to/42tJKOL Real Python realpython.com • Narrative technical writing stephengruppetta.com/breaking-the-r… • Track & Field Athletics backonthetrack.substack.com • Everything
    2.5K
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Mar 24, 2024
    Replying to @tunguz
    The one you're buying next month stopped working today
    103K
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Apr 11, 2022
    What's an image made of? There are many correct answers. But the most fascinating one is: << sines & cosines >> Read on if you're intrigued👇🧵🪡 #python #images #fourier
    Image
    00:00
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Oct 31, 2022
    I know many schools are using The Python Coding Book and its tutorials for teaching Python Although this content was written with adult learners in mind, a lot of the work I do daily involves teaching kids, so glad to see schools use this resource Some highlights 👇
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Jun 3, 2022
    Are `a = []` and `a = list()` the same? How about `a = a[::-1]` and `a.reverse()`? Let's look as some list operations to see whether they're the same or not… Read more… 👇🪡🧵 #python #programming /1
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Apr 5, 2023
    Object-Oriented Python at the Hogwarts School of Codecraft and Algorithmancy --- Year 5: Inheritance --- The students are growing up! This Year they'll learn about a key property of OOP - how to create a class that inherits from another one Here's the code so far /1
    Image
    52K
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Apr 13, 2022
    #Matplotlib is not just for displaying data… …here I use it for a fun simulation of planets orbiting a sun (or many suns, see next tweet) Here's the article if you're looking for a step-by-step tutorial: thepythoncodingbook.com/2021/12/11/sim… #python #planets @matplotlib
    Image
    00:00
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Jul 29, 2022
    So, you've never accessed data over the internet using an API and don't know where to start? Start with the simplest option… The World Bank site has some free data with an easy to use API Here's an example using the `requests` library 👇🪡🧵
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Dec 23, 2022
    The way Python deals with variables is different from some other languages. You may even have heard some say they're not technically variables Let's visualise what's happening when you create a name in Python and assign data to it with The Box and Label analogy /1
    >>> numbers = [3, 10, 8, 2]
>>> more_numbers = numbers

>>> del more_numbers
>>> del numbers
    Image
    54K
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Dec 8, 2022
    A small headache for learners is knowing how to format their code In Python, some of this matters as it's part of the syntax But other aspects of formatting are linked to style rather than syntax and can confuse those learning to code Let's dive further into this /1
    names = [
    "Stephen",
    "James",
    "Mary",
    "Bob",
    "Kate",
    "Ishann",
    "Sarah",
    "Kevin",
    "Zahra",
    "Keith",
    "Matthew",
]


def find_names_starting_with(letter, data):
    output = []
    for name in data:
        if name[0] == letter:
            output.append(name)
    return output


names_p = find_names_starting_with("K", names)
print(names_p)
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Nov 4, 2022
    Day 8 in the Python functions series Yesterday we saw the "rogue" forward slash in the function definition. Today, it's the "rogue" asterisk or star * def greet(host, *, guest): Let's look at keyword-only arguments today /1
    def greet(host, *, guest):
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    May 5, 2022
    Back to basics: what do sine and cosine really mean? This is a mini-project using turtle I do with secondary school children who have learnt about sines and cosines but don't **really** know what they are. I'm debating whether to write this as a… #python #coding 1/
    Image
    00:00
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Nov 6, 2022
    One of the most underrated #Python modules? `turtle` We know it's used for teaching & not in the "real-world" But it's usually used only for basic drawings & simple animations for kids–a very limited scope We can teach more advanced topics, too… Here are some examples… /1
  • user avatar
    Stephen Gruppetta
    @s_gruppetta
    Feb 26, 2023
    Let's write this game in 20 tweets… Yes, just 20 Ready? Go… • Balls appear in random positions every few seconds and are tossed upwards with random velocities • Click close to the ball to "bat it up" • How long until you lose 10 balls? /1
    Image
    00:00
    105K
Advertisement
Advertisement