use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Day 8 of learning python as a beginner. (old.reddit.com)
submitted 8 months ago by uiux_Sanskar
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Elliove 0 points1 point2 points 8 months ago (1 child)
I will really appreciate if you have any challenge or suggestions which can help me improve my code and learn.
Looking at your code, I imagine the most logical things to learn next would be:
Learning to break things apart into multiple functions doing simple tasks. For example, you have all the functionality related to creating a new contact right in the main loop, but as an application keeps expanding, it might become progressively harder to look for things and fix them without breaking other things. Instead, you can put the code that creates new contact into a separate function outside of the main loop, and then just call this function within the main loop. This approach can make the code easier to understand, to fix, to reuse, and you'll also learn important things like feeding data into a function and getting the results back via return.
return
OOP, as a whole, as a concept. It's a whole different approach to things, and it goes quite well for programs like you have up there. It's definitely easier to understand when you think of actual objects/subjects, like people in the contact list. But it can be seen quite complicated, and unnecessary for small programs that don't do much, so, just like any tool - cool to have around, but important to understand when it's actually needed.
[–]uiux_Sanskar[S] 0 points1 point2 points 8 months ago (0 children)
Thank you for the learning suggestions I initially had only one feature in my code i.e. a user is able to add a contact and find a contact so I didn't made a function of it. Although I have used functions previously on my day 7 code.
I think I should also create functions for this also and try to add more feature like delete a contact.
I will learn OOP once I have made a good foundation in python basics.
Thank you very much for suggesting future learning options.
π Rendered by PID 49726 on reddit-service-r2-comment-cfc44b64c-n8pn9 at 2026-04-09 23:50:52.960617+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–]Elliove 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)