Everything About Python — Beginner To Advanced

Everything About Python — Beginner To AdvancedEverything You Need To Know In One ArticleFarhad MalikBlockedUnblockFollowFollowingMar 9This article aims to outline all of the key points of Python programming language.

My target is to keep the information short, relevant and focus on the most important topics which are absolutely required to be understood.

After reading this blog, you will be able to use any Python library or implement your own Python packages.

You are not expected to have any prior programming knowledge and it will be very quick to grasp all of the required concepts.

I will also highlight top discussion questions that people usually query regarding Python programming language.

Lets build the knowledge gradually and by the end of the article, you will have a thorough understanding of Python.

Please let me know whether you want me to post exercises and their solutions to help you practice Python.

This article contains 25 key topics.

Let’s Start.

Photo by Curtis MacNewton on Unsplash1.

Introducing PythonWhat Is Python?Interpreted high-level object-oriented dynamically-typed scripting language.

Python interpreter reads one line of code at a time, interprets it into low level machine language (byte code) and then executes it.

As a result, run time errors are usually encountered.

Why Python?Python is the most popular language due to the fact that it’s easier to code and understand it.

Python is object oriented programming language and can be used to write functional code too.

It is a suitable language that bridges the gaps between business and developers.

Subsequently, it takes less time to bring a Python program to market compared to other languages such as C#/Java.

Additionally, there are a large number of python machine learning and analytical packages.

A large number of communities and books are available to support Python developers.

Nearly all type of applications, ranging from forecasting analytical to UI, can be implemented in Python.

There is no need to declare variable types.

Thus it is quicker to implement a Python application.

Why Not Python?Python is slower than C++, C#, Java.

This is due to the lack of Just In Time optimisers in Python.

Python syntactical white-space constraint makes it slightly difficult to implement for new coders.

Python does not offer advanced statistical features as R does.

Python is not suitable for low-level system and hardware interaction.

How Does Python Work?This image illustrates how python runs on our machines:The key here is the Interpreter that is responsible for translating high level Python language to low level machine language.

2.

Variables — Object Types And ScopeVariables store information that can be used in your program such as to hold user inputs, local states of your program etc.

Variables are also known as names in Python.

Python supports numbers, strings, sets, lists , tuples and dictionaries.

These are the standard data types.

Declare And Assign Value To VariableAssignment sets a value to a variable:myFirstVariable = 1mySecondVariable = 2myFirstVariable = "Hello You"Assigning a value is known as binding in Python.

Note how I assigned an integer value of 1 and then a string value of “Hello You” to the myFirstVariable variable.

This is possible due to the fact that the data types are dynamically typed in python.

NumericIntegers, decimals, floats are supported.

value = 1 #integervalue = 1.

2 #float with a floating pointLongs are also supported.

They have a suffix of L e.

g.

9999999999999LStringsTextual information.

Strings are sequence of letters.

String value is enclosed in quotation marks:name = 'farhad'Strings are immutable.

Once they are created, they cannot be changed e.

g.

a = 'me'a[1]='y'It will throw a Type ErrorWhen string variables are assigned a new value then internally, Python creates a new object to store the value.

Variables can have local or global scope.

Local ScopeVariables declared within a for/while loop or within a function, as an example, can only exist within the block.

Once the block exists, the variables also become inaccessible.

def some_funcion(): TestMode = Falseprint(TestMode) <- Breaks as the variable doesn't exist outsideGlobal ScopeVariables that can be accessed from any function have a global scope.

They exist in the __main__ frame.

You can declare a global variable outside of functions.

It’s important to note that to assign a global variable a new value, you will have to use the “global” keyword:TestMode = Truedef some_function(): global TestMode TestMode = Falsesome_function()print(TestMode) <–Returns FalseRemoving the line “global TestMode” will only set the variable to False within the some_function() function.

Note: Although I will write more on the concept of modules later, but if you want to share a global variable across a number of modules then you can create a shared module file e.

g.

configuration.

py and locate your variable there.

Finally, import the shared module in your consumer modules.

Finding Variable TypeIf you want to find type of a variable, you can implement:type('farhad')–> Returns <type 'str'>Comma In Integer VariablesCommas are treated as sequence of variables e.

g.

9,8,7 is three numeric variables3.

OperationsAllows us to perform computation on variablesNumeric OperationsPython supports basic *, /, +, -Python also supports floor division1//3 #returns 0.

333.

1/3 #returns 0 as both of the operands are integersAdditionally, python supports exponentiation via ** operator:2**3 = 2 * 2 * 2 = 8Python supports Modulus (remainder) operator too:7%2 = 1String OperationsConcat Strings:'A' + 'B' = 'AB'Repeat String:‘A’*3 will repeat A three times: AAASlicing:y = 'Abc'y[:2] = aby[1:] = cy[:-2] = ay[-2:] = bcReversing:x = 'abc'x = x[::-1]Negative Index:If you want to start from the last character then use negative index.

y = 'abc'print(y[:-1]) # will return cAlso used to remove any new line carriages/spaces.

Finding Indexname = 'farhad'index = name.

find('r')#returns 2name = 'farhad'index = name.

find('a', 2) # finds index of second a#returns 4For Regex, use:split(): splits a string into a list via regexsub(): replaces matched string via regexsubn(): replaces matched string via regex and returns number of replacementsCastingstr(x): To stringint(x): To integerfloat(x): To floatsSet OperationsSet is an unordered data collection.

We can define a set variable as:a = {1,2,3}Intersect SetsTo get what’s common in two setsa = {1,2,3}b = {3,4,5}c = a.

intersection(b)Difference In SetsTo retrieve the difference between two sets:a = {1,2,3}b = {3,4,5}c = a.

difference(b)Union Of CollectionsTo get a distinct combined set of two setsa = {1,2,3}b = {3,4,5}c = a.

union(b)Ternary OperatorUsed to write conditional statements in a single line.

Syntax:[If True] if [Expression] Else [If False]For example:Received = True if x = 'Yes' else False4.

CommentsSingle Line Comments#this is a single line commentMultiple Line CommentsOne can use:“`this is a multilinecomment“`5.

ExpressionsExpressions can perform boolean operations such as:Equality: ==Not Equal: !=Greater: >Less: <Greater Or Equal >=Less Or Equal <=6.

PicklingConverting an object into a string and dumping the string into a file is known as pickling.

The reverse is known as unpickling.

7.

FunctionsFunctions are sequence of statements which you can execute in your code.

If you see repetition in your code then create a reusable function and use it in your program.

Functions can also reference other functions.

Functions eliminate repetition in your code.

They make it easier to debug and find issues.

Finally, functions enable code to be understandable and easier to manage.

In short, functions allow us to split a large application into smaller chunks.

Define New Functiondef my_new_function(): print('this is my new function')Calling Functionmy_new_function()Finding Length Of StringCall the len(x) functionlen('hello')prints 5ArgumentsArguments can be added to a function to make the functions generic.

This exercise is known as generalization.

You can pass in variables to a method:def my_new_function(my_value): print('this is my new function with ' + my_value)Optional arguments:We can pass in optional arguments by providing a default value to an argument:def my_new_function(my_value='hello'): print(my_value)#Callingmy_new_function() => prints hellomy_new_function('test') => prints test*arguments:If your function can take in any number of arguments then add a * in front of the parameter name:def myfunc(*arguments): return amyfunc(a)myfunc(a,b)myfunc(a,b,c)**arguments:It allows you to pass varying number of keyword arguments to a function.

You can also pass in dictionary values as keyword arguments.

ReturnFunctions can return values such as:def my_function(input): return input + 2If a function is required to return multiple values then it’s suitable to return a tuple (comma separated values).

I will explain tuples later on:resultA, resultB = get_result()get_result() can return ('a', 1) which is a tupleLambdaSingle expression anonymous function.

It is an inline function.

Lambdas do not have statements and they only have one expression:my_lambda = lambda x,y,z : x – 100 + y – zmy_lambda(100, 100, 100) # returns 0Syntax:variable = lambda arguments: expressionLambda functions can be passed as arguments to other functions.

dir() and help()dir() -displays defined symbolshelp() — displays documentationPhoto by Noah Silliman on Unsplash8.

ModulesWhat is a module?Python is shipped with over 200 standard modules.

Module is a component that groups similar functionality of your python solution.

Any python code file can be packaged as a module and then it can be imported.

Modules encourage componentised design in your solution.

They provide the concept of namespaces help you share data and services.

Modules encourage code re-usability and reduces variable name clashes.

PYTHONPATHThis environment variable indicates where the Python interpreter needs to navigate to locate the modules.

PYTHONHOME is an alternative module search path.

How To Import Modules?If you have a file: MyFirstPythonFile.

py and it contains multiple functions, variables and objects then you can import the functionality into another class by simply doing:import MyFirstPythonFileInternally, python runtime will compile the module’s file to bytes and then it will run the module code.

If you want to import everything in a module, you can do:import my_moduleIf your module contains a function or object named my_object then you will have to do:print(my_module.

my_object)Note: If you do not want the interpreter to execute the module when it is loaded then you can check whether the __name__ == ‘__main__’2.

FromIf you only want to access an object or parts of a module from a module then you can implement:from my_module import my_objectThis will enable you to access your object without referencing your module:print(my_object)We can also do from * to import all objectsfrom my_module import *Note: Modules are only imported on the first import.

If you want to use C module then you can use PyImport_ImportModuleUse import over from if we want to use the same name defined in two different modules.

9.

PackagesPackage is a directory of modules.

If your Python solution offers a large set of functionalities that are grouped into module files then you can create a package out of your modules to better distribute and manage your modules.

Packages enable us to organise our modules better which help us in resolving issues and finding modules easier.

Third-party packages can be imported into your code such as pandas/sci-kit learn and tensor flow to name a few.

A package can contain a large number of modules.

If our solution offers similar functionality then we can group the modules into a package:from packageroot.

packagefolder.

mod import my_objectIn the example above, packageroot is the root folder.

packagefolder is the subfolder under packageroot.

my_module is a module python file in the packagefolder folder.

Additionally, the name of the folder can serve as the namespace e.

g.

from data_service.

database_data_service.

microsoft_sql.

modNote: Ensure each directory within your package import contains a file __init__.

py.

Feel free to leave the files blank.

As __init__.

py files are imported before the modules are imported, you can add custom logic such as start service status checks or to open database connections etc.

PIPPIP is a Python package manager.

Use PIP to download packages:pip install package_name10.

ConditionsTo write if then else:if a = b: print 'a is b'elif a < b: print 'a is less than b'elif a > b: print 'a is greater than b'else: print 'a is different'Note how colons and indentations are used to express the conditional logic.

Checking Typesif not isinstance(input, int): print 'Expected int' return NoneYou can also add conditional logic in the else part.

This is known as nested condition.

#let's write conditions within elseelse: if a = 2: print 'within if of else' else: print 'within else of else'11.

LoopsWhileProvide a condition and run the loop until the condition is met:while (input < 0): do_something(input) input = input-1ForLoop for a number of timesfor i in range(0,10)Loop over items or characters of a stringfor letter in 'hello' print letterOne-Liner ForSyntax:[Variable] AggregateFunction([Value] for [item] in [collection])YieldingLet’s assume your list contains a trillion records and you are required to count the number of even numbers from the list.

It will not be optimum to load the entire list in the memory.

You can instead yield each item from the list.

xrange instead of range can be used to iterate over the items.

Combine For with IfLet’s do a simple exercise to find if a character is in two wordsname = 'onename'anothername = 'onenameonename'for character in name: if character in anothername print characterBreakIf you want to end the loopfor i in range(0,10): if (i==5): breakwhile True: x = get_value() if (x==1): breakLet’s write Fibonacci for loop:def fib(input): if (input <=1): print(str(input)) else: first = 0 second = 1 count = 0 for count in range(input): result = first + second print(first) first = second second = result count += 1 fib(7)12.

RecursionA function calling itself is known as recursion.

Let’s implement a factorial recursive function:Rules:0!.= 1 #Factorial of 0 is 1n!.= n(n-1)!.#Factorial of n is n * factorial of n-1Steps:Create a function called factorial with input nIf n = 0 return 1 else do n x factorial of n-1def factorial(n): if n==0: return 1 else: return n * factorial(n-1)Another Example: Let’s write Fibonacci recursive function:Rules:First two digits are 0 and 1Rest add last two digits0, 1, 1, 2, 3, 5, 8…Steps:Create a function called fibonacci that takes in an input nCreate two variables first and second and assign them with values 0 and 1if n =0 return 0, if n = 1 return 1 else return (n-1) + (n-2)def fibonacci(n): if (n<=1): return n else: return fibonacci(n-1)+fibonacci(n-2)print(fibonacci(6))It is important to have an exit check otherwise the function will end up in infinite loop.

13.

Frames And Call StackPython code is loaded into frames which are located into a Stack.

Functions are loaded in a frame along with the parameters and variables.

Subsequently, frames are loaded into a stack in the right order of execution.

Stack outlines the execution of functions.

Variables that are declared outside of functions are stored in __main___Stacks executes the last frame first.

You can use traceback to find the list of functions if an error is encountered.

14.

CollectionsListsLists are data structures that can hold a sequence of values of any data types.

They are mutable (update-able).

Lists are indexed by integers.

To create a list, use square brackets:my_list = ['A', 'B']To add/update/delete an item, use index:my_list.

append('C') #adds at the endmy_list[1] = 'D' #updatemy_list.

pop(1) # removesordel my_list[1:2] # removesmy_list.

extend(another_list) # adds second list at endAddition, repetition and slices can be applied to lists (just like strings).

List also supports sorting:my_list.

sort()TuplesTuples are like lists in the sense that they can store a sequence of objects.

The objects, again, can be of any type.

Tuples are faster than lists.

These collections are indexed by integers.

Tuples are immutable (non-update-able)my_tuple = tuple()ormy_tuple = 'f','m'ormy_tuple = ('f', 'm')Note: If a tuple contains a list of items then we can modify the list.

Also if you assign a value to an object and you store the object in a list and then change the object then the object within the list will get updated.

DictionariesDictionary is one of the most important data structure in programming world.

It stores key/value pair objects.

It has many benefits e.

g.

optimised data retrieval functionality.

my_dictionary = dict()my_dictionary['my_key'] = 1my_dictionary['another_key'] = 2You can also create a dictionary as:my_dictionary = {'my_key':1, 'another_key':2}Print dictionary contentsfor key in dictionary: print key, dictionary[key]Values of a dictionary can be of any type including strings, numerical, boolean, lists or even dictionaries.

dictionary.

items() # returns items#checking if a key exists in a dictionaryif ('some key' in dictionary): #do somethingNote: If you want to perform vectorised/matrix operations on a list then use NumPy Python package15.

Compilation And LinkingThese features can be utilised to use a file that is written in another language e.

g.

C or C++ etc.

Once the code is written into a file then the file can be placed in the Modules directory.

It is important to add a line in the Setup.

local file to ensure that the newly created file can be loaded.

Compilation:Allows compilation of new extensions without any errorLinking:Once the extensions are compiled, they can be linked.

16.

IteratorsIteratorsAllow traversing through a collectionAll iterators contain __iter__() and __next__() functionsSimply execute iter(x) on lists, dictionaries, strings or sets.

Therefore we can execute next(iter) where iter = iter(list) as an instance.

Iterators are useful if we have a large number of items in a collection and we do not intend to load all of the files in memory at once.

There are common iterators which enable developers to implement functional programming language paradigm:FilterFilter out values based on a conditionMapApplies a computation on each value of a collection.

It maps one value to another value e.

g.

Convert Text To IntegersReduceReduces a collection of values to one single value (or a smaller collection) e.

g.

sum of a collection.

It can be iterative in nature.

ZipTakes multiple collections and returns a new collection.

The new collection contains items where each item contains one element from each input collection.

It allows us to transverse multiple collections at the same timename = 'farhad'suffix = [1,2,3,4,5,6]zip(name, suffix)–> returns (f,1),(a,2),(r,3),(h,4),(a,5),(d,6)17.

Object Oriented Design — ClassesPython allows us to create our custom types.

These user-defined types are known as classes.

The classes can have custom properties/attributes and functions.

Object oriented design allows programmers to define their business model as objects with their required properties and functions.

A property can reference another object too.

Python classes can reference other classes.

Python supports encapsulation — instance functions and variables.

Python supports inheritance.

class MyClass: def MyClassFunction(self): #self = reference to the object return 5#Create new instance of MyClass and then call the functionm = MyClass()returned_value = m.

MyClassFunction()An instance of a class is known as an object.

The objects are mutable and their properties can be updated once the objects are created.

Note: If a tuple (immutable collection) contains a list (mutable collection) of items then we can modify the list.

Also if you assign a value to an object and you store the object in a list and then change the object then the object within the list will get updated.

__init____init__ function is present in all classes.

It is executed when we are required to instantiate an object of a class.

__init__ function can take any properties which we want to set:class MyClass: def __init__(self, first_property): self.

first_property = first_property def MyClassFunction(self): return self.

first_property#Create an instancem = MyClass(123)r = m.

MyClassFunction()r will be 123Note: self parameter will contain the reference of the object, also referred to as “this” in other programming languages such as C#__str__Returns stringified version of an object when we call “print”:m = MyClass(123)print m #Calls __str__Therefore, __str__ is executed when we execute print.

__cmp__Use the __cmp__ instance function if we want to provide custom logic to compare two objects of the same instance.

It returns 1 (greater), -1 (lower) and 0 (equal) to indicate the equality of two objects.

Think of __cmp__ like Equals() method in other programming language.

OverloadingMethods of an object can be overloaded by providing more arguments as an instance.

We can also overload an operator such as + by implementing our own implementation for __add__Shallow Vs Deep Copy Of ObjectsEquivalent objects — Contains same valuesIdentical objects — Reference the same object — same address in memoryIf you want to copy an entire object then you can use the copy moduleimport copym = MyClass(123)mm = copy.

copy(m)This will result in shallow copy as the reference pointers of the properties will be copied.

Therefore, if one of the properties of the object is an object reference then it will simply point to the same reference address as the original object.

As a result, updating the property in the source object will result in updating the property in the target object.

Therefore shallow copy copies reference pointers.

Fortunately, we can utilise deep-copy:import copym = MyClass(123)mm = copy.

deepcopy(m)If MyClass contains a property that references MyOtherClass object then the contents of the property will be copied in the newly created object via deepcopy.

Therefore, deep copy makes a new reference of the object.

18.

Object Oriented Design — InheritancePython supports inheritance of objects.

As a result, an object can inherit functions and properties of its parent.

An inherited class can contain different logic in its functions.

If you have a class: ParentClass and two subclasses: SubClass1, SubClass2 then you can use Python to create the classes as:class ParentClass: def my_function(self): print 'I am here'class SubClass1(ParentClass):class SubClass2(ParentClass):Consequently, both subclasses will contain the function my_function().

Inheritance can encourage code re-usability and maintenance.

Note: Python supports multiple inheritance unlike C#Use Python’s abc module to ensure all subclasses contain the required features of the Abstract Base Class.

Multi-Inheritance:class A(B,C): #A implments B and CIf you want to call parent class function then you can do:super(A, self).

function_name()19.

Garbage Collection — Memory ManagementAll of the objects in Python are stored in a heap space.

This space is accessible to the Python interpreter.

Python has an in-built garbage collection mechanism.

It means Python can allocate and de-allocate the memory for your program automatically such as in C++ or C#.

It’s responsibility is to clear the space in memory of those objects that are not referenced/used in the program.

As multiple objects can share memory references, python employs two mechanisms:Reference counting: Count the number of items an object is referenced, deallocate an object if its count is 0.

The second mechanism takes care of circular references, also known as cyclic references, by only de-allocating the objects where the allocation — deallocation number is greater than threshold.

New objects are created in Generation 0 in python.

They can be inspected by:import gccollected_objects = gc.

collect()Manual garbage collection can be performed on timely or event based mechanism.

20.

I/OFrom KeyboardUse the raw_input() functionuser_says = raw_input()print(user_says)FilesUse a with/as statement to open and read a file.

It is equivalent to using statement in C#.

with statement can take care of closing of connections and other cleanup activities.

Open fileswith open(file path, 'r') as my_file: for line in my_file#File is closed due to with/asNote: readline() can also be executed to read a line of a file.

To open two fileswith open(file path) as my_file, open(another path) as second_file: for (line number, (line1, line2)) in enumerate(zip(my_file, second_file):Writing fileswith open(file path, 'w') as my_file: my_file.

write('test')Note: Use os and shutil modules for files.

Note: rw — read-write mode and a — append mode.

SQLOpen a connectionimport MySQLdbdatabase = MySQLdb.

connect(“host”=”server”, “database-user”=”my username”, “password”=”my password”, “database-name”=”my database”)cursor = database.

cursor()Execute a SQL statementcursor.

fetch("Select * From MyTable")database.

close()Web ServicesTo query a rest serviceimport requestsurl = 'http://myblog.

com'response = requests.

get(url).

textTo Serialise and Deserialise JSONDeserialise:import jsonmy_json = {"A":"1","B":"2"}json_object = json.

loads(my_json)value_of_B = json_object["B"]Serialise:import jsona = "1"json_a = json.

dumps(a)21.

Error HandlingRaise ExceptionsIf you want to raise exceptions then use the raise keyword:try: raise TypErrorexcept: print('exception')Catching ExceptionsTo catch exceptions, you can do:try: do_something()except: print('exception')If you want to catch specific exceptions then you can do:try: do_something()except TypeError: print('exception')If you want to use try/catch/finally then you can do:try: do_something()except TypeError: print('exception')finally: close_connections()finally part of the code is triggered regardless, you can use finally to close the connections to database/files etc.

Try/Except/Elsetry: do somethingexcept IfTryRaisedException1: do something elseexcept (IfTryRaisedException2, IfTryRaisedException3) if exception 2 or 3 is raised then do somethingelse: no exceptions were raisedWe can also assign exception to a variable by doing:try: do somethingexcept Exception1 as my_exception: do something about my_exceptionIf you want to define user-defined constraints then use assert:assert <bool>, 'error to throw'Note: Python supports inheritance in exceptionsYou can create your own exception class by:class MyException(Exception): pass22.

Multi-Threading And GILGIL is Global Interpreter Lock.

It ensures that the threads can execute at any one time and allows CPU cycles to pick the required thread to be executed.

GIL is passed onto the threads that are currently being executed.

Python supports multi-threading.

Note: GIL adds overheads to the execution.

Therefore, be sure that you want to run multiple threads.

23.

DecoratorsDecorators can add functionality to code.

They are essentially functions that call other objects/functions.

They are callable functions — therefore they return the object to be called later when the decorated function is invoked.

Think of decorates that enable aspect-oriented programmingWe can wrap a class/function and then a specific code will be executed any time the function is called.

We can implement generic logic to log, check for security checks etc and then attribute the method with the @property tag.

24.

Unit Testing In PythonThere are a number of unit testing and mocking libraries available in Python.

An example is to use unittest:1.

Assume your function simply decrements an input by 1def my_function(input): return input – 12.

You can unit test it by:import unittestclass TestClass(unittest.

TestCase): def my_test(self): self.

assertEqual(my_function(1), 0)) #checking 1 becomes 0We can also use doctest to test code written in docstrings.

25.

Top Python Discussion QuestionsWhy Should I Use Python?Simple to code and learnObject oriented programming languageGreat Analytics and ML packagesFaster to develop and bring my solution to marketOffers in-built memory management facilitiesHuge community support and applications availableNo need to compile as it’s an interpreted languageDynamically typed — no need to declare variablesHow To Make Python Run Fast?Python is a high level language and is not suitable to access system level programs or hardware.

Additionally it is not suitable for cross-platform applications.

The fact that Python is a dynamically typed interpreted language makes it slower to be optimised and run when compared to the low level languages.

Implement C language based extensions.

Create multi-processes by using Spark or HadoopUtilise Cython, Numba and PyPy to speed up your Python code or write it in C and expose it in Python like NumPyWhich IDEs Do People Use?Spyder, PyCharm.

Additionally various notebooks are used e.

g.

JupyterWhat Are The Top Python Frameworks And Packages?There are a large number of must-use packages:PyUnit (unit testing), PyDoc (documentation), SciPy (algebera and numerical), Pandas (data management), Sci-Kit learn (ML and data science), Tensorflow (AI), Numpy (array and numerical), BeautifulSoap (web pages scrapping), Flask (microframework), Pyramid (enterprise applications), Django (UI MVVM), urllib (web pages scraping), Tkinter (GUI), mock (mocking library), PyChecker(bug detector), Pylint (module code analysis)How To Host Python Packages?For Unix: Make script file mode Executable and first line must be:#(#!/my account/local/bin/python)2.

You can use command line tool and execute it3.

Use PyPRI or PyPI serverCan Python and R be combined?A large number of rich statistical libraries have been written in ROne can execute R code within Python by using Rpy2 python package or by using beaker notebook or IR kernel within Juputer.

Is there a way to catch errors before running Python?We can use PyChecker and PyLink to catch errors before running the code.

Photo by Curtis MacNewton on UnsplashSummaryThis article outlined the most important 25 concepts of Python in a short, relevant and focused manner.

I genuinely hope it has helped someone get better understanding of Python.

I believe I have concentrated on the must know topics which are absolutely required to be understood.

This knowledge is sufficient to write your own python packages in the future or using existing Python packages.

Rest, just practice as much as possible and you can implement your own library in Python because this article contains all the knowledge you need.

If you want me to post Python exercises and solutions then please let me know.

Hope it helps.

.

. More details

Leave a Reply