For the latter, a good approach is to pick a project or idea and try to make it. If you’re familiar with the logic you can look up the syntax for the new language, but it you’re fresh off the boat then there is a bunch of good stuff on YouTube, Khan academy and stack overflow that are geared to newbies.
Some starting ideas:
- Make a text based tic Tac toe/card game
- Make a number guessing game
- Find all prime numbers under a number given by the user
Once you’ve got a decent grip on the logic involved, it can be quite effective to implement more complex approaches to the solution. Instead of guessing randomly, implement a binomial (1:N divided by 2) search algorithm, or have the game play against itself. Go back over how you wrote the solution, and add some good comments, improve the functions descriptions, even refactor some code to be more efficient and more readable. I learnt how to code through doing, textbooks are great for some people but my preferred approach is to make something, break it, and learn how to fix it.
Unrelated, this is a good thing to hear, I have an old MacBook air 2012 lying around, a supported OS would be handy to make use of the hardware still being in excellent condition.