Online Programming Tutorials | Web Tutorials | PHP Tutorials

Python Exceptions

In Python language, we got two kinds of errors, the first is Syntax errors and another exception. Syntax errors are raised due to some syntactical mistakes. They can be removed by modifying the code, whereas Exceptions can be defined as unusual events that interrupt the program's normal flow of execution. Read More

Python Files I/O

A File in a computer is defined as a pointer to a memory location on the secondary storage device (it can be Hard Disk, USB, SSD, etc.). Files allow managing and organizing digital data conveniently. Without Files, the user needs to remember the memory location of the data required. Read More

Python Modules

Python has an excellent feature of structuring and organizing the codes. These range from statements and control structures through functions, methods, and classes at the scripts level and modules and packages at the libraries level. A module is a file containing a piece of prewritten code that allows a program to perform a function or task without coding it inside the program. Python modules are also saved as ".py" extension Read More

Python Functions

A function is a small piece of code that aims to perform a particular task. Functions take an argument as an input and return an output after completing some set of actions on the input. Once defined, Functions can be called numerous times without defining them repeatedly. Thus, functions make the code reusable. Read More

Python Sets

>A Python set is a collection of unique elements which are not in any particular order. It is declared using comma-separated values within braces {}. It has been in Python since version 2.4. The common mathematics operations can be carried out on python sets, such as the intersection, difference, complement, and union of two sets. A Python set's elements can be Heterogenous or Homogenous. Since each element is unique in a Set, duplicate elements are automatically expunged. Python sets do not require indexing because of their unordered nature. The elements contained in the Set are in an immutable form, but the Set itself can be changed. Read More

Python Dictionary

Dictionary is a special associative object type in Python in which data are saved as a collection of key and value pairs in the form of {key:value}. It allows data access based on a key rather than an index and stores objects based on their key. There is no order in which the pairs are stored. Dictionaries are mutable in nature, so elements can be added, altered, and deleted. A dictionary cannot use another dictionary object as a key, but an element's value can be any valid Python type, immutable or mutable. Also, the values of two or more keys can be the same, but the keys themselves need to be unique. Read More

Python Tuples

A tuple is a Sequence Data Type in Python. It consists of a number of values inside parentheses instead of square brackets, separated by commas. Tuples can contain multiple values, making writing programs that handle large amounts of data more accessible. These values can be Homogenous or Heterogenous(i.e., different data types). Tuples, like strings, are immutable. Tuples cannot have their values modified, appended, or removed. Its elements cannot be modified individually. Though, tuples can be reassigned to a new set of elements. Read More

Python Lists

Python list is an ordered collection of data types like Integer, Strings, and Objects. Lists are the Python equivalent of arrays in other languages, but Lists are more powerful and versatile. Lists are mutable themselves; hence, they can be altered and store mutable elements, and elements in a list can be heterogeneous or homogeneous. Read More

Python Numbers

Python provides various ways to represent numeric data in the code. It is achieved through Python's three main numeric data types, namely Int, Float and Complex. Read More

Python Strings

Strings are an ordered collection or sequence of characters. They are used to store information in the form of text. Strings are immutable in Python. Once a String is assigned a value, its value cannot be modified (It can be reassigned or completely deleted). Read More

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies Find out more here