Python – Exceptions Handling Python – Exceptions Handling¶Python provides very important features to handle any unexpected error in your Python programs and to add debugging capabilities in them − Here is a list all the standard Exceptions available in Python −¶1: Exception Base class for all exceptions 2: StopIteration Raised …
Read More »Python Files Handling
12 File Handling Python File Handling¶File handling is an important part of any web application.Python has several functions for creating, reading, updating, and deleting files. Functions used in File Handling¶ open() close() read() write() seek() tell() The key function for working with files in Python is the open() function.¶ The …
Read More »Python Modules
Python Modules What is a Module?¶Consider a module to be the same as a code library. A file containing a set of functions you want to include in your application. Create a Module¶ To create a module just save the code you want in a file with the file extension …
Read More »Python Functions
Python Functions Python Function¶ A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function. A function can return data as a resul A colon (:) to mark the end of the function header. An optional return …
Read More »Python Sets
Python Sets Python Set¶A set is an unordered collection of items. Every set element is unique (no duplicates) and must be immutable (cannot be changed). Sets are used to store multiple items in a single variable. Set is one of 4 built-in data types in Python used to store collections …
Read More »Python Dictionary
Python Dictionary Python Dictionary¶Dictionaries are used to store data values in key:value pairs. A dictionary is a collection which is ordered*, changeable and does not allow duplicates. Dictionaries are written with curly brackets, and have keys and values: {‘Key’:’Value’} Note:As of Python version 3.7, dictionaries are ordered. In Python 3.6 …
Read More »Python Tuples
Python Tuple Python Tuples¶Tuples are used to store multiple items in a single variable. Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Set, and Dictionary, all with different qualities and usage. A tuple is a collection which …
Read More »Python Lists
Python List Python Lists¶Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage. Lists are created using square brackets: …
Read More »Python Strings
String in Python Strings in Python : MachineLearning.org.in¶Strings are used in Python to record text information, such as name. Strings in Python are actually a sequence, which basically means Python keeps track of every element in the string as a sequence. For example, Python understands the string “hello’ to be …
Read More »Python Numbers
Python Numbers Python Numbes¶Number data types store numeric values. They are immutable data types, means that changing the value of a number data type results in a newly allocated object. Python supports four different numerical types −¶ int long float complex In [1]: x = 10 # int y = 3.28 …
Read More »