- Notifications
You must be signed in to change notification settings - Fork22
kaushikthedeveloper/GeeksforGeeks-python
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Following project containsPython3 implementation of the Algorithms and Questions found in GeeksforGeeks.
“Talk is cheap. Show me the code.”― Linus Torvalds
1. # <link reffering to the respective GeeksforGeeks page>2. <from module import module | if any>3. <Data Structures used | if any>4. <Primary Function : handles the computation> : return the desired result (whenever possible)5. <Helper functions | if any>6. # main7. if __name__=="__main__" :8. <inside main> : get input from the user : pre-processing of data | if required : call the function : print the result9. Documentation for the code : Input Explanation : Input <Example> : Output <Example>10. Documentation of the GeeksforGeeks page content
- For better code understanding, please follow theStyle guide for python (PEP 8) recommendations as per the Python docs.
- Keep the code/documentation within warp of100 letters. If the line exceeds this limit, bring it down to the next line.
- Also, do not forget to leave ample number of comments!!
“Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?'”– Steve McConnell
Imp : In the code, provideFunction Annotations as perPEP 3107 -- Function Annotationsfor every parameter passed in a function. Return type specification is optional.
Annotations forparameters take the form of optional expressions that follow the parameter name:
deffoo(a:expression,b:expression=5): ...#Ex :deffoo(l:list,s:str='xyz'): ...#In pseudo-grammar, parameters now look like identifier [: expression] [= expression]
Annotations for the type of a function's return value take the form of optional expressions that is done like so:
deffoo()->expression: ...#Ex :defsum()->int: ...
About
GeeksforGeeks Algorithms and Questions implemented in Python
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.