Ask HN: Teaching Python to 16 yo as their first PL. Fun projects to get started?

This year, I have a class of 12 kids in eleventh grade (in French, we call them "Première") to whom I'm supposed to teach this new "Numerical and Computer Science" class [0].

The program is actually pretty interesting (by school standards). The course used to be in Java, but switched to Python two years ago. It's intended for complete beginners and aims at explaining basic CS concepts through Python.

I'm supposed to give them both individual and small group assignments in Python. I found some stuff on the Internet of course, but do you recommend any website, resource, idea for young newcomers?

[0] https://eduscol.education.fr/cid144156/nsi-bac-2021.html

8 points | by fdeage 1285 days ago

13 comments

  • poplarstand 1284 days ago
    My younger brother is in the same age range. He was interested in programming, so I pointed him towards Automate the Boring Stuff with Python. He has done well since, with his latest project being a simple mouse-wiggler script that sets his status to "online" for his school's mandatory online attendance checks.

    Looking back at the learning process, the most useful parts of Automate the Boring Stuff with Python were the mini-projects: web scraping, GUI automation, and other immediately visible tools that helped a student to build tangible things. Once he had those, my little brother could figure out his own projects, like automating redundant tasks in the video games he plays.

    Conversely, the least useful part of the book was its fundamentals. In retrospect I should've started him on a different tool like Codecademy. The instantaneous "correct/incorrect" feedback was a better fit for clearing the initial hurdle in understanding syntax.

  • saradhi 1284 days ago
    Automate the boring stuff is definitely great stuff; I started my web scraping through it. However, I feel it may be a little too much for the 12th grade; again, it may be just me, with very late into the programming interest. My experience when giving recommendations is not to make multiple things learn in parallel. It is always easier to start with a project which we routinely do. The idea is to be clear on the process and outcome, and then achieve it in a non-routine process, programming. The approach will help not easily give up the task, and also brings interest. So, maybe you to list out the tasks that the kids usually do or even ask to list down their favorite/routine tasks and guide them through the programmatic approach.
  • t-vi 1284 days ago
    Given the societal impact, I think a simple recommender system would be really important. Recommender systems literally shape the world we see.

    Poll anything they might have a preference on (and not all the same) - movies, music, internet celebrities or what not - and build a system that asks someone's opinion on 5 things and then outputs suggestions.

    I don't think you need anything fancy, but just counting "same entries" in the preference matrix would work to get basic collaborative filtering. Depending on the depth allowed, you can cast that more mathematically and maybe even discuss the idea of rank 1 factorizations (i.e. assign each person / thing a vector and attempt to approximate the matrix entries as scalar products) or optimization of that stuff.

    As outlook, you have word2vec that works similar but has the added complication of the matrix being huge. Use that for a information retrieval or toy chat bot or whatever.

    I did teach this to non-experts, but not high school kids. I imagine it would work similarly. Unfortunately, I don't know of a website that covers this for school kids.

    • fdeage 1281 days ago
      Thank you for your reply. I had never thought about that, and never done it myself, but it definitely sounds doable as a final group project!
  • giantg2 1284 days ago
    I like to see physical results.

    I have a Pi Zero with an environment that can give you temp/pressure/etc and blink LEDs. I also have an automation hat that provides the ability to interface with stepper motors or other things. They use Python. There are quite a few projects related to these online, covering various domains and skill levels.

  • tmaly 1282 days ago
    Take a look at using the microbit

    https://microbit.org/get-started/user-guide/python/

    Having a hands on project is pretty cool for kids.

    • fdeage 1282 days ago
      I'll have a look, thanks!
  • disown 1284 days ago
    > The course used to be in Java, but switched to Python two years ago.

    Why? Are they all comfortable with the english language? Why not find a french language PL and teach them that?

    https://en.wikipedia.org/wiki/Linotte

    I'm guessing all the libraries, documentation, etc would be in french.

    > It's intended for complete beginners and aims at explaining basic CS concepts through Python.

    Why would you use a programming language to teach basic CS concepts? Also, does it have to be fun? Must we be having fun at all times?

    • fdeage 1281 days ago
      Well, it doesn't _have_ to, but fun is surely easier! Also, I'm sure there are PL in French but they are a niche, which means less choices, less examples, etc. Plus, it isn't that much of a barrier in Python. In the end, it's easier to find French documentation for an english PL than find a French PL.
    • armatav 1284 days ago
      Clearly you have not interacted with a kid who’s on the fence about programming.

      It’s a hard business, teaching someone super young that it’s really worth staring at a bunch of code blocks all day.

      It’s even harder to prove to them that not only is it useful, but it’s not boring.

      Kids need fun and exploration to pique their interest in a topic. No, it doesn’t have to be fun all the time, but good luck getting them started with “build me a calculator in C please”.

  • 7373737373 1284 days ago
    Perhaps a simple website with flask: https://flask.palletsprojects.com/en/1.1.x/quickstart/
    • fdeage 1282 days ago
      I was considering Flask too... It introduces a lot of stuff and layers they won't understand at first, but getting their feet wet on web development would be very interesting.
    • 2rsf 1283 days ago
      But that requires a bit more knowledge beyond just Python, it is not necessarily bad and they can learn a lot from it but it might be to complex.
      • Doxin 1283 days ago
        "Hello World" in flask is barely more lines than "Hello World" in the console. If anything it's a good on-ramp for webdev.
  • camdencheek 1284 days ago
    My favorite project to give kids who are just dipping their toes in the water is a Madlib. It prompts you for the blank words, then prints out the complete story with the blanks filled.
  • bitwize 1284 days ago
    Text adventure! Graphical adventure with PyGame! Program a robot! (My 11yo nephew has decided that his future career lies in programming Mars rovers.)
    • fdeage 1282 days ago
      Text adventure could definitely work well! As soon as I talked about the input() function, they were kind of doing that already :)
  • tetris11 1284 days ago
    implement a casino game, roulette or blackjack or guess the weight of the pound cake
    • fdeage 1282 days ago
      Very nice idea!
  • beamatronic 1284 days ago
    A text based maze game ala Zork
    • Lammy 1284 days ago
      Compare it to Minecraft, not Zork, if you want to capture current 16-year-olds’ attention :)
  • grafelic 1284 days ago
    A scientific calculator.
    • fdeage 1282 days ago
      What functionalities are you thinking about? Proper float handling to prevent the '0.1 + 0.2 = 0.30000000004' bug? Manual computation of square roots/sinus functions?
  • brudgers 1284 days ago
    Why not ask the kids?
    • 2rsf 1283 days ago
      From my experience they don't know where to begin and would come up with suggestions that are way too complex and big
      • fdeage 1282 days ago
        I agree. However, showing them different projects and ask to pick some of them could work well.
      • brudgers 1283 days ago
        That sounds like an important discussion of an important lesson.