Python Loops

A loop statement in programming is used to execute a line or block of code repeatedly. For example, suppose you want to print the “Hello World!” string 100 times you can do this in two ways either use a print statement 100 times or use a loop with a condition to run it 100 times. … Read more

Python Indentation

An indentation or indent is an empty space at the beginning of a line that signals the start of a new logical block in a Python program. Many programming languages such as c and c++ uses curly braces to describe a block of code, indentation used just for readability in them. Indentation is very important … Read more

Operators in Python

An operator is a symbol that tells the Python interpreter to perform specific arithmetic or logical operations on variables and values. For example – # Here + and = are examples of operators in Python sum = 5+6 print(sum) Python has the following type of built-in operators. Arithmetic operators Relational operators Logical operators Bitwise operators … Read more

Keywords In Python

Like other programming languages, Python also has some reserved words whose meaning is already defined by the Python interpreter these reserved words are known as Keywords. A keyword cannot be used as the identifier. For example, you can not use a variable with the name def because it is a Python keyword that is used … Read more

Escape sequences in Python

An escape sequence or escape character allows you to insert a special character in a string. For example, you can insert a new line in a string using \n character. The backslash \ is used before the character that you want to escape. List of escape characters in Python The following table shows you a … Read more

Python Boolean Data Type

Boolean or bool is a built-in data type in the python programming language. It can have two possible values –   True  False These are equivalent to 1 and 0 respectively, the values that are used in languages like c or c++.  It is generally associated with conditional statements. Either a condition will be true … Read more

Python Numeric Data Types

Numeric data types are numbers stored in the memory. You can perform operations such as addition, subtraction, multiplication, division, modulo, etc on numeric data. The following data types can be categorized as numeric types. int float complex Integer type Integers are the whole numbers means there are no floating-point values in them. A variable of … Read more

Exit mobile version