Python – For Loops

The for loop in Python is different from other programming languages like C and Java. A for loop in Python is used to iterate over a sequence or a collection (list, tuple, dictionary, etc.). Syntax of For Loop In the above for loop syntax, the variable takes the next value from sequence until the last…

Read More »

Python – While Loop

Loops in Python Language is used to repeat a block of code for several times until a specific result is obtained. Suppose you have to print your name several times, instead of printing multiple lines you can use loops. Python has two types of loops. While Loop For Loop The While Loop in Python The…

Read More »

Python – If Else, Decision Making

In this tutorial, we will learn about the conditional statements for decision making in Python. In Python, to check the condition, the if-else statement is used. The if-else statement in Python, helps the interpreter to execute the instructions based on the given condition. Different forms of the if-else statement are given below. if if-else if-elif-else…

Read More »

Python – Print

In this tutorial, we will learn about print() function in Python. It is used to print specific data as the output on the screen or output device. You can print a Text, number, variable or an object in Python using a print() method. Print Example in Python The print object can be a string or…

Read More »

Python – Input

In this Python tutorial, we will learn how to accept user input in Python. Python has a rich set of built-in functions, in this tutorial we will discuss one of them, input() function for input operation. Python Input Function Python 3 has a built-in function input(), to accept keyboard input. The input() method reads a…

Read More »

Python – Operators

In Python, operators are symbols and used to perform a specific operation on given values. Python has a rich collection of operators, we will learn here. Types of Operators in Python Arithmetic Operators Assignment Operators Relational Operators Logical Operators Bitwise Operators Membership Operators Identity Operators Arithmetic Operators (Mathematical Operators) Arithmetic or Mathematical operators in Python…

Read More »

Python – Data Types

In the previous chapter, we had learned about variables. In this tutorial, we will discuss data types in Python language. In Python programming, data types are inbuilt and need not declare the type of a variable. Everything in Python is an object, so data types are classes and variables are known as an object. Numeric…

Read More »

Python – Variable

In this tutorial, we will learn about variables in Python. we will also discuss to define a variable, assign a value to variables in Python. What is Variable: In Python, variables are a memory location. It can store values like numbers and text. The value of a variable can be changed. The variable is always…

Read More »