Category Archives: Python Tutorial

Python for Loop Syntax Plus Examples

Python for loop Statement Syntax Plus Examples – This is a Python tutorial to explain the syntax and use of for loop with different practical examples in Python scripts. Python for Statement We can use a Python for statement for two main puposes: Use a for loop to iterate over items in a sequence Using… Read More: Python for Loop Syntax Plus Examples »

Loading

Python User Defined and Built-in Functions – Defining and Using Functions

‘Python User Defined and Built-in Functions – Defining and Using Functions’ is our Python tutorial to explain the use of Python functions in Python programs / scripts. We will cover the following topics on Python Functions: Python Functions Defining and Using Functions What is a Function? Importance of Functions Advantages of  Using Functions Types of… Read More: Python User Defined and Built-in Functions – Defining and Using… »

Loading

Python Variable Names and Naming Rules

Python Variable Names and Naming Rules is a Python tutorial to explain the rules and importance of choosng good names for your variables in a program. Choose Short but Meaningful Variable Names Python Variable names shoud be short but meaningful. It will add in program readability. For example, ‘num’ is a better variable name than… Read More: Python Variable Names and Naming Rules »

Loading

Python Math Operators

Python Math Operators are the special symbols to perform common mathematical operations on data called operands. The Math operators include the following: Table Explaining the Use of Python Math Operators Math Operator Used for Example Result + Addition 2+9 11 – Subtraction 9-2 7 * Multiplication 7*5 35 / Division 7/2 3.5 // Integer Division… Read More: Python Math Operators »

Loading

Python if elif else Statement with Example Programs

Python if elif else Statement decides to select only one block of statements from many given block of statements. It selects a block on the basis of the condition related to that block. It means that if elif else statement has many conditions and corresponding blocks of statements. If a given condition is true, if… Read More: Python if elif else Statement with Example Programs »

Loading

Python if else statement

Python if else statement is another form of Python if statement. It executes one block of statements, if the given condition is true and the other when it is false. So there are two blocks in if else statement – if-block and else-block. Syntax of Python if else Statement if condition: if-block else: else-block Where… Read More: Python if else statement »

Loading