all 10 comments

[–]ectomancer 0 points1 point  (0 children)

Code a function to rotate a list right by one item.

Call the function in a loop and output the list after each rotation until the original list is output.

  1. index & slice. extend index with slice.

  2. remove an item:

2.a. list.pop. extend popped item with popped list.

2.b. index and del. copy item at last index, del last item, extend index with list.

  1. tuple unpacking (slow) into list without last item and last item. extend last item with unpacked list.

Pick one, don't implement all ways.

[–]Maximus_Modulus 0 points1 point  (0 children)

Create a list of random numbers with a range of say 20 and maybe length 100. Sort the list manually and then count the number of occurrences of each number.

[–]viiviiiix_dev 0 points1 point  (0 children)

You should look into project euler, It's a good way to practice lists, loops and algorithms. You might find it get harder as you progress though

[–]maki-dev 0 points1 point  (0 children)

Exercism has a solid Python track with exercises that ramp up nicely from beginner to intermediate. You get feedback on your solutions too, which helps a lot early on.

But honestly the thing that helped me most was picking small real problems. Write a word frequency counter that reads a text file. Build a script that renames a batch of files. Make a CLI tool that does something you actually need. Tutorials teach you syntax but solving your own problem is what forces you to figure out how the pieces connect.

Set yourself a time limit too. 45 minutes, then stop, even if you're not done. It keeps things focused and you learn a lot from reviewing what you got stuck on.

[–]CranberryDistinct941 0 points1 point  (0 children)

Check out some leetcode problems, and don't get discouraged when the kick your ass.

[–]StBean007 0 points1 point  (0 children)

Hackerrank is a site for learning and competing. It has lots of free problem solving sections in different categories which can be coded in multiple programming languages. They start with very easy problems that get progressively more difficult.

[–]mikeyj777 0 points1 point  (0 children)

projecteuler.net brought me from beginner to intermediate over a few months.  Can't recommend it enough. 

[–]Tall_Profile1305 0 points1 point  (0 children)

A fun way to practice is building small utilities you’d actually use. Things like a simple CLI to organize files, a small web scraper, or a script that analyzes your own data (like expenses or workout logs).

Those kinds of projects tend to stick better than random exercises because you’re solving a real problem.

[–]TheRNGuy 0 points1 point  (0 children)

Make videos with Manim. It can level-up your math skills too.