CodeNewbie Community 🌱

Nic
Nic

Posted on

Learning a bit about... Python part 2

Last week I learnt the basics of Python. This week I learnt some things you can do with it.

Game

I did a Pong in Python tutorial and it was fun. It was for beginners to coding and I did think that some bits of code were quite repetitive and it could be improved, but I don't know how. And the point of this isn't to know how, it's just to know a bit about the language.

Also, setting the ball speed was a bit interesting. Sometimes it would be so fast it would fly off before I could even think about moving the paddle and sometimes it was so slow I got bored waiting for it to reach the paddle. And sometimes it would start fast and then slow down. My guess is that it's very affected by whatever else is going on on my computer. The trick was mostly to run it a few times until it was the right speed, and then play.

I just had to stop myself from wanting to put semi-colons at the end of lines, and put 'const' before all the variable declarations.

API

For this I did a REST API tutorial. This started off with a talk about APIs, which was a good reminder. Then we used one, which was fine. And then made one, using Flask and an SQL database and I pretty much had no idea what was going on. It was too much new stuff in one go.

Web scraping

This was a short tutorial about using Beautiful Soup. Because he had the code already written, just commented out, I was often ahead of him, with understanding what was going on. It was just an introduction, but I can imagine you'd want to put what you'd got in a database.

What's next?

Another language! I could quite happily do more Python tutorials (I was very tempted, but three in one day was definitely enough). I could learn it properly, if I wasn't wrapped up in JavaScript-y things.

The point of this was to learn a little about a language I'm curious about and I have achieved that.

Top comments (0)