
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sarika Singh has Published 189 Articles

Sarika Singh
2K+ Views
In Python, the except clause is used to handle exceptions that may occur inside a try block. But what happens if no exceptions are raised? The except block is simply skipped. When No Exceptions Occur If the code inside the try block executes without raising any exceptions, the except block ... Read More

Sarika Singh
368 Views
In Python, you can create your own custom exception classes to represent specific types of errors in your program. When you raise these custom exceptions, you can also pass an object (like a string or other data) to explain more about what went wrong. This helps make your error messages ... Read More

Sarika Singh
282 Views
While executing the program, if any statement results in an abnormal value (based on the inputs) where the interpreter doesn't know how to behave. Python throws an exception.In Python, we can also throw or raise an exception manually using the raise keyword. This is helpful when you want to ... Read More

Sarika Singh
1K+ Views
While executing the statements that perform arithmetic operations, if any operation results in an illegal value, an arithmetic exception occurs (run time).In Python, ArithmeticError represents this exception, and it is the base class for all errors that occur during arithmetic operations, such as division by zero, overflow, or floating-point errors. ... Read More

Sarika Singh
2K+ Views
SyntaxError in Python occurs when the interpreter encounters invalid syntax, such as missing colons, unmatched parentheses, incorrect indentation, or invalid keywords. Since this error happens during the code compilation stage (before execution), it cannot be caught using a regular try-except block. To handle it, you must wrap the faulty code ... Read More

Sarika Singh
8K+ Views
In Python, an IOError (or OSError in latest versions) occurs when an input/output operation fails. For example, when we are trying to read a file that doesn’t exist, writing to a file that is read-only, or accessing a corrupted device. You can catch IOError using a try-except block to handle ... Read More

Sarika Singh
737 Views
In Python, you can check whether a substring exists within another string using Python in operator, or string methods like find(), index(), and __contains__(). A string in Python is a sequence of characters that is enclosed in quotes. You can use either single quotes '...' or double quotes "..." to ... Read More

Sarika Singh
195 Views
In Python, exception names usually end with "Error" (like ZeroDivisionError, NameError, and TypeError). This clearly shows that they are related to problems that happen while the program is running. Using this naming style makes error messages easier to read, helps with debugging. Why exceptions end with "Error" An exception is ... Read More

Sarika Singh
2K+ Views
To pass a variable to an exception in Python, provide the variable as an argument when raising the exception. For custom exceptions, store the variable in an attribute. You can pass variables like strings or numbers directly into built-in exceptions to include dynamic data in the error message. Example: Passing ... Read More

Sarika Singh
96K+ Views
Python has a built-in method called values() that returns a view object. The dictionary values are listed in the view object. We can use the values() method in Python to retrieve all values from a dictionary. Python's built-in values() method returns a view object that represents a list of dictionaries ... Read More