r/learnpython • • Mar 22 '23

What do you even code?

I am a beginner to python and all coding. I don't know much. All the recommendations are "code everyday". Practice every day is great but what do I practice? Do I open up an empty IDE and code what? I don't know how to do any projects on my own. Do I just YouTube crap and copy them or what? What do I actually code?

341 Upvotes

107 comments sorted by

View all comments

8

u/Cha_r_ley Mar 22 '23

Start simple

Make lists of things- names, foods, countries, car models, whatever. Then start building functions that get gradually more complex.

Write codes to

  • choose 15 random items from the list

  • to check if those items start with a vowel and if so, add them to a new list

  • write the new (vowel-starting) list to a .txt file

  • read BACK the txt file, form a new list and select a specific item from it by index

  • iterate through the list sorted alphabetically, or by word length, or iterate through in reverse

  • prompt a user for an input, check if the input already exists in the list. If not, it adds it to the list

  • count the number of items in the list. If it’s even, that’s fine. If it’s odd, delete the last item.

You start with something small and simple that gets you used to the formatting and the syntax, then you start branching out into other areas. It’ll give you ideas for stuff to build, and prompts to look up more complex code.

Once you start to feel more confident, I highly recommend joining Codewars.com to try some of their challenges. They cover a lot of different programming languages and ability levels. It’s a great learning resource!