this post was submitted on 28 Aug 2023
27 points (100.0% liked)

Python

6408 readers
3 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
27
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/python
 

What's the best way to teach my kid programming. I don't know how. He's interested. He's done well in school with Scratch. He's expressed interest in Python, owns a Thumby, but never gets too far on his own. Instead of a Winter sport, we're leaning towards a Python class, however there's none in person. How can i help my kid embrace his passion and learn this skill which will help him his whole life.

He's got Mu installed and has perused youtube tutorials, but they dont hold his interest. Any help is appreciated. Edit: He's 10.

top 19 comments
sorted by: hot top controversial new old
[–] [email protected] 15 points 1 year ago* (last edited 1 year ago)

I think the biggest thing is, instead of learning for learning's sake, they should decide on a simple project they want to make (choose your own adventure games would likely be a good choice) and then just learn enough to make a bare-bones version of that.

Like, I would recommend learning basic string handling, input, print, and maybe variables if you want to track Strength or HasWeapon or things like that. Then, once they're familiar with that, they can add features by learning more about the language as necessary.

Even for me, a 30-something, watching YT tutorials is boring if it's not specifically addressing a problem in facing on a project I care about.

[–] [email protected] 7 points 1 year ago (2 children)

Python is a great first language. Websites can be a lot of fun, because all you really need is an html file for your browser to read. It gets arbitrarily complex but is simple at first, to do layouts and styles. I used to make little text adventure games as a kid, "go left" "attack monster" kinda stuff with hit points and a town

https://www.khanacademy.org/computing/computer-programming is an epic free resource / course, with interactivity. Not for Python specifically, but for coding fundamentals, and includes little interactive stuff

Brilliant is also quite successful, and they are really trying to keep it simple, with visual coding

Overall, I'm not too sure what a 10 year old can absorb, but probably more than expected

[–] orrefailaT 3 points 1 year ago

Seconding the linked Khan Academy course, i taught a class for a few years that followed those lessons. The lessons are a little outdated, but they’re perfectly suitable for learning fundamental JS syntax.

The visual aspect, imo, is super helpful when first learning. Being able to see the results of your code makes understanding what’s happening way easier. Additionally, those lessons provide hints and friendly reminders to help with syntax errors.

Those lessons in particular use a JS library called P5.js if you want to play around with it outside of the Khan Academy environment. More than enough for making a simple game, and the documentation is pretty great too.

[–] [email protected] 1 points 1 year ago (1 children)

Do you know if sites like that can be run from Github, through a Github site?

My seven year old wants to learn how to 'make things' on the computer, so if they're going to go down the programming route, I'd like to do it properly :)

[–] orrefailaT 4 points 1 year ago (1 children)

Github Pages would be a great way to get something like that up and running on the web! If your kid is wanting to just play around without diving into git or deployment, creating a text file ending in .html and opening it with a browser is probably the easiest way to get started.

[–] [email protected] 3 points 1 year ago (2 children)

Thanks for replying :)

I should have clarified, sorry. I've got some Github sites running, but just using HTML, CSS, and JavaScript. I know they run on a Github page, but I also know that some backend stuff doesn't. I was wondering if Python scripts for the games that Lung described could run on one too.

I've been tinkering with HTML and CSS for a few years, but it's only fairly recently that I've started doing it properly, and added JavaScript. Python may as well be a foreign language for now, so I can't even try something simple to see what works. I've got a book to learn from but I haven't had a chance to go through it yet :)

[–] orrefailaT 3 points 1 year ago (1 children)

Thanks for the clarification! Yeah I think you’re right that running python on a github page isn’t possible (at least not straightorward). Replit might be closer to what you’re looking for in that regard. I love it because it handles setting up your programming environment for you and lets you dive right into what you actually want to do (write and run code). Sharing the link to your project lets anyone open it up and run it in their browser!

[–] [email protected] 2 points 1 year ago

I'll have a look into it, thanks :)

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

You should stick to JavaScript for web. Running Python in a GitHub page is technically possible, but I really don't recommend it. Python and JS are very similar languages, right in the same family of single threaded interpreted C-style languages. If you learn one, the other is almost identical, with slightly different syntax

To answer your question, GitHub pages cant run a backend service, no. There's a good chance you don't really need one yet. Your GitHub page can load publicly hosted JavaScript libraries just with a URL, and it can use existing third party services. For example, you could use a free Google Firebase account to enable login/accounts, and never have to build a backend for it yourself

When you do decide to write backends, you can do that in JavaScript too, using Node.js. It's real easy, but there is a lot to know about networking, concurrency, server management, etc. But you can also write Python backends really easily. My favorite language for this is Google's Go

I'm gonna say -1 to the suggestion of replit - never heard of that service and appears to be some AI startup. If you wanna do backend, just head to Google Cloud or Amazon Web Services. Google Cloud is my provider, and they have a lot of great options. For example, you can make a "Cloud Function" which is a type of "serverless" technique - you just write one little blob of code, set up the configuration, and it gets magically executed when conditions are met or a request is made. Then you can skip knowing 99.9% of what goes into making the magic work and just write the code. Or when you want more complete control, you can look at Google Cloud Run for a pretty easy full site/backend system, and Kubernetes for the really advanced modern tech. Google gives out a ton to free computation hours, so you can likely build a full backend without spending anything in cloud run

[–] [email protected] 2 points 1 year ago

That's a great answer, thank you :)

Sorry I didn't reply sooner, I managed to miss the notification.

I still get frontend and backend stuff mixed up, but I'm getting there slowly. I need to learn more, especially as I want to be able to add push notifications to a web app I'm working on (opt in only, of course). It's a site and app for a small music festival, so I'm going to try to put in notifications for late changes to the lineup, and maybe reminders for when a chosen artist is due to start. Should hopefully be a fun challenge :)

[–] K2yfi 6 points 1 year ago* (last edited 1 year ago)

https://www.hedycode.com/ might be exactly what you are looking for. It's designed to teach python to children by starting with a super simplified version of the language, and then gradually adding in syntax and features until it's full python. Here's a great talk by its creator: https://youtu.be/fmF7HpU_-9k?si=pa7jkOELQ5X7xeuu

[–] [email protected] 5 points 1 year ago (1 children)

If you can find a local team, Lego robotics competitions are a great thing: https://www.firstinspires.org/robotics/fll/game-and-season

My local team codes in Python. Not necessarily the greatest thing for learning to code properly, but the engineering experience is invaluable IMO.

[–] orrefailaT 1 points 1 year ago

In a similar vein, if there are no local teams near you, getting some sort of microcontroller that runs micropython could be fun too. I’m a big fan of microbit for younger kids, lots of options for lights and sounds, with a few pins for adding sensors/buttons etc.

[–] [email protected] 4 points 1 year ago (1 children)

A former professor of mine is developing a game called "Joy of programming". It's basically a UE5 simulation that has some scenarios that you need to solve by writing python. It'll be part of the upcoming steam next fest in october, so you can give it a shot there.

A 10 year old won't be able to do it alone, but I think the first few levels are great with a bit of supervision.

[–] [email protected] 1 points 1 year ago

Ya this is like doing a science fair project with your kid to help them understand the scientific method. It's a good way to get them motivated to learn since a lot of being educated is really how to teach yourself

[–] [email protected] 3 points 1 year ago

Harvard has its CS50 lectures online for free. Can't hurt.

[–] [email protected] 3 points 1 year ago

I don’t have anything to add, but I’ve got to say thanks for posting this. There’s so much good info in this thread and I can’t wait to dig into it with my kids. Cheers everyone

[–] learnbyexample 2 points 1 year ago

If he likes games, check out "Invent Your Own Computer Games with Python": https://inventwithpython.com/invent4thed/

[–] [email protected] 1 points 1 year ago

I can find no use for the turtle module, but it might be mighty interesting for a younger mind.