Rajendra Dharmkar has Published 537 Articles

Where's the standard python exception list for programmers to raise?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

I want to know what all standard exceptions are there in python. Where can I find a list of standard python exceptions?The standard python exception list for programmers is available athttps://docs.python.org/3/library/exceptions.html

What is the most efficient string concatenation method in python?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

The best way of appending a string to a string variable is to use + or +=. This is because it's readable and fast. They are also just as fast. Other than this, if you're working with 2 strings, append() can also be used.If you are concatenating a list of ... Read More

What is the max length of a Python string?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

With a 64-bit Python installation, and 64 GB of memory, a Python 2 string of around 63 GB should be quite feasible. If you can upgrade your memory much beyond that, your maximum feasible strings should get proportionally longer. But this comes with a hit to the runtimes.With a typical ... Read More

What is the maximum file size we can open using Python?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

There is no reachable maximum on the size of a file Python can open. People regularly load gigabytes of data into memory. Depending on your computer's RAM and whether it's 64- or 32- bit OS/processor, the practical maximum for you may be anywhere from 1 GB up before you get ... Read More

Why are Python exceptions named "Error" (e.g. ZeroDivisionError, NameError, TypeError)?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

We see that most exceptions have their names ending in word ‘error’ pointing that they are errors which is the meaning of exceptions anyway.Errors in restricted sense are taken to mean syntax errors in python and those errors occurring at run time are called exceptions. As we know that classes ... Read More

Where can I find good reference document on python exceptions?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

The following link is a  good reference document on python exceptionshttps://docs.python.org/2/library/exceptions.html

What is a namespace in Python?

Rajendra Dharmkar

Rajendra Dharmkar

Updated on 30-Jul-2019 22:30:20

Namespace is a way to implement scope. In Python, each package, module, class, function and method function owns a "namespace" in which variable names are resolved. When a function,  module or package is evaluated (that is, starts execution), a namespace is created. Think of it as an "evaluation context". When ... Read More

Advertisements