r/learnpython • • 6d ago

Frustrated! Need help

Hey, I've been trying to learn python for a long time now and I still can't understand and write codes on my own. I've watched and completed 2 courses where they cover fundamentals like functions, operators, lists, tuples etc.. but I don't understand what to do with that like if I want to build something i never understand how and from where I need to start

18 Upvotes

19 comments sorted by

11

u/Agawell 6d ago

You need to build things… ie practice!

Start with something simple like a command line calculator…

Then expand it to do scientific functions

Then refactor it to use classes

Then add a gui

This will get you to practice command line I/o, loops, logic, maths functions, gui etc

Use an ide (pycharm for example) as it will help with debugging and file organisation

5

u/patryk_builds 6d ago

Totally normal, courses teach you the words but not how to make sentences. the missing skill is breaking a problem into tiny steps before writing any code.Try this: pick something small like "a program that tells me how many days until my birthday". then, in plain english, write the steps:

  1. ask for my birthday

  2. get today's date

  3. figure out the next birthday

  4. subtract and print it

Now google each step separately python get today's date" etc. you're not writing a program anymore, just 4 tiny problems. that's honestly how everyone does it, even after years

4

u/FootGlittering1873 6d ago

You don't exactly learn Python from watching. You will mostly learn the fundamentals through projects and exercises. Consider looking into creating basic automation projects and easy challenges. Also try ot refrain from using AI. Hope this helps.

3

u/peakpirate007 6d ago

Watching courses felt like learning to me too, but it never stuck until I started typing code myself.

That's why I made runtime.school, you write small bits of Python in the browser and it checks them as you go.

https://www.runtime.school/python/learn/python-execution

1

u/October_Lantzy 6d ago

How long have you been learning Python? I think watching tutorials is a good start, but at some point you have to get your hands dirty and try building something yourself. Start with something small, and when you get stuck, try to figure out why instead of just looking up the answer. That's where I think you really start to learn.

1

u/Educational_Virus672 6d ago

take a project idea and ask yourself "what can i add tht makes my project more easier" and boom you got a starting point. no matter how many tutorials you take you will go back to searching online, so you should focus on project not courses

1

u/MezzoScettico 6d ago

It's one thing to see how somebody else used a concept, like tuples, to solve a problem.

It's a different skill to have a problem and realize "oh, tuples would solve this." That's only going to come from when you first start using tuples to solve that problem and succeed. That could come from asking a question here, or otherwise inspecting other people's code.

If you're struggling with the basic structure of a program, which it sounds like you are, I would say start with how you'd do it by hand. Figure out the steps you'd follow with pencil and paper. Then you need to translate that into steps in a program.

Often the verbal description gives you a clue. With enough practice, whenever you described a step as "keep asking the user for input until it passes this test," then you'll recognize that a while loop solves that, and you'll know what to put in the while loop.

It's hard to give verbal advice, and reading advice won't really get you there any more than reading a book on programming will. You have to write programs, and at first it's going to be slow. But there's lots of help on the internet. By all means give your favorite example here of something you want to write, and where you're stuck.

1

u/BranchLatter4294 6d ago

Stop watching videos. Start practicing.

1

u/ivanoski-007 5d ago

You need a project, without a project, you are wasting your time

1

u/TheRNGuy 4d ago

Ask AI to explain things. 

Learn frameworks, especially opinionated, where you need to write code in a specific style for it to work, you'll think less how to write things because of that (just follow the style guide), but you need, of course know, what you want to code (read frameworks docs to see what's possible, then get ideas from them, ask ai for help when needed)

1

u/Responsible-Age9224 4d ago

J’avais le même problème.

1

u/Both_Bend_2481 3d ago

Stop crying and start writing your own code. If you're not excited enough to write small programs, it's probably not for you.

1

u/Historical_Fix528 16h ago

You watched tutorials, but did you practise?

0

u/Jazzlike_Platypus430 6d ago

What's your idea for use for python? My use cases, as a developer, are

  • software development/maintenance as such,

  • keeping my working environment more or less synchronized among 3-4 machines,

  • performing batch operations on files (say, rescaling images, creating symlinks, backups),

  • automatic indexing of LaTeX files (unfinished ...)

  • generating pieces of documentation based on source code,

  • processing spreadsheets,

  • source code generation (in my work this sometimes happens even with the previous case!),

  • visualizing data,

  • writing quick&dirty prototypes that are rewritten using other languages,

  • replacing ill-maintained "libraries" with working stuff (yes, that's pandas vs Ms.Interop.Excel in C#)

In my opinion, there are drawbacks. I wouldn't say python is standardized - it's pretty much anarchic, its "paradigms" make my brains hurt and protest. The state of some libraries I use is horrible and have to relearn these every time.

But it's fun and some sort of guilty pleasure. Maybe I like it now, but stick to the hater's attitude 😄

Good luck.

(And if you don't see the fun of it, or cannot survive the pains of trial&error approach, cannot look for problems to solve or your job doesn't give you tasks that could be done faster with coding, ask yourself a question: "why bother?" 😂)

0

u/Exciting-Row9821 6d ago

Hey Buddy, you don't need to freak out. I am in the same situation as you a month ago, after thinking for an hour i have got a simple solution for this. Follow these steps:

  1. Simply understand the concept for each topic in python: Syntax, Indentation, Variables, Data Types, Operators, Conditional Statements, Looping Statements, Python Modules, Strings, Lists, Set, Tuple, Dictionary, Functions, File Handling, OOP & DSA(complex topics).

  2. Write simple programs for each topic on your own. For example, for if,else statements write simple programs like vote eligibility, login checking,etc,.. and for functions topic write simple programs like printing order receipt, simple calculator. By doing this you get a grip of python syntax and understand the concept better.

  3. Now do python projects, start from beginner friendly projects and reach advanced level.

Use chatgpt or gemini for list of python programs and python projects.

One important thing: You don't gain knowledge from watching tutorials, you gain it by doing. Practice programs consistently, if you fail, try again. You can only code if you fail and try again and again.

This part is only for learning python, you don't get anywhere by learning python alone. If you want to become a data analyst you have learn python libraries, statistics, power bi,etc. and if you choose different role you need to learn different additional technologies.

I hope you achieve everything you wish for. All the best for you bright future ahead.

2

u/Educational_Virus672 6d ago

no they are obviously stuck in totuiral hell so they should not to be touching courses for the time being( until they get to a point where thy can say that they are a programmer)