The glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell. The results are returned in arbitrary order. Linux and Unix systems and shells also support glob and also provide function glob() in system libraries. …
The float type in Python designates a floating-point number. float values are specified with a decimal point. The Python float() method returns a floating point number from a number or a string.
File handling is allowing the users to handle files i.e., to read and write files, along with many other file handling options, to operate on files. In Python, the files are treated as text or binary. Every line of a …
An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program’s instructions. Even if a statement or expression is syntactically correct, it may cause an error when an attempt is …
Encapsulation is one of the fundamental concepts in object-oriented programming. Encapsulation is the idea of wrapping data and the methods within one unit. This provides restrictions on accessing variables and methods directly and can prevent the unknown modification of data. …
Python is a dynamically typed language. What is dynamic typing? Simple saying we won’t have to declare the type of variable while assigning a value to a variable in Python. It states the kind of variable in the runtime of the program. …
The Cursor of the mysql-connector Python module is used to execute statements to communicate with the MySQL database. We can create a Cursor object using the cursor() method of the connection object. Given below are the various methods provided by the Cursor …
A CSV (Comma Separated Values) format is one of the most simple and common ways to store tabular data. To represent a CSV file, it must be saved with the .csv file extension. The columns are separated by a comma and there …
In this article, we will learn about bitwise operators. Bitwise operators are those operators which perform bitwise operations on numbers. The bitwise operators in Python first convert the decimal number into binary and perform operations bit-by-bit and finally returns the …
A tuple is a collection of objects which ordered and immutable. Tuples are sequences, just like lists. The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses, whereas lists use square brackets. …