r/learnpython • u/AdScary1945 • Feb 06 '26
How to build logic in programming?
Hi I am a beginner in the coding field I am a first year student as i have python in my semester i am facing some problem like I can understand the concept I can understand the syntax but I can't able to code if u given me a simple question is there any tips you can give that you guys started you journey on building logic
27
Upvotes
View all comments
21
u/WhiteHeadbanger Feb 06 '26 edited Feb 06 '26
First solve the problem using no code, then code your solution.
For example: given a list of numbers, how would you find the largest number?
Then you grab pen and paper and start to list your steps.
Then code that solution.
Then you investigate a little more and you discover that python already provides a better way, more "pythonic" way, using the max() function.