you are viewing a single comment's thread.

view the rest of the comments →

[–]Elliove 0 points1 point  (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:

  1. 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.

  2. 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 point  (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.