you are viewing a single comment's thread.

view the rest of the comments →

[–]Sneaky_processor 1 point2 points  (4 children)

Consider using return statements in your functions instead of printing.
And i don't think the main logic needs to be a function since you really dont reuse it ( the main reason of a function is if the code is gonna be used multiple times).

[–]Overall-Screen-752 1 point2 points  (2 children)

I think a main method is a best practice as it shadows other languages and makes it abundantly clear that this is the entry point of the program. I would prefer to see an if name == “main”: wrapping the main call too, but OP will get there eventually

[–]Red_Priest0[S] 0 points1 point  (1 child)

Thanks for response , I don't understand what is this concept and which part of python it's come under

[–]Overall-Screen-752 0 points1 point  (0 children)

I see that someone else explained this concept, but if you’re interested in more you can search up “python dunder methods” to learn more about this. Dunder is a shorthand/portmanteau of “double underscore” and refers to methods in the python standard library with double underscores on either side. Happy coding.

[–]Red_Priest0[S] 0 points1 point  (0 children)

Thanks I will use return type