break in python

break: It is used to terminate the loop execution. It can be used inside the loop only It can terminate infinite loop also. We cannot use break to terminate a block. Block executes only once, …

Python Nested loops

Nested Loops: Defining a loop inside another loop. Inner loop condition evaluates only when outer condition is valid. Execution terminate only when outer condition fails. Nested while loop codes: The following code snippets are used …

Python for loop

for loop: “for” is a keyword. It is another looping control statement. “for” is used to execute a block of instructions repeatedly as long as the specified condition is valid. In python, for loop uses …

while loop in python

While loop: “while” is a keyword. “while” is used to execute a block repeatedly until condition is valid. “while” takes only condition as expression. Syntax: Flow Chart: As condition always True, it repeats infinite times: …

Python Nested if block

Nested – If: Defining if block inside another if block. Inner block condition evaluates only when outer condition is valid Simple code: Output it: We can define else block for every nested if block: Number …

Python if-else block

If-else block: Else block is used to execute a block of instructions when if block fails. No need to specify condition for else block. “else” block is optional for if-block. Syntax: FlowChart: We can specify …

Python if block

If – block: “if” is a keyword. “if” block is used to execute a block only if the condition is valid. We can place the condition directly or with parenthesis Syntax: or Flow Chart: Simple …

Python Control Statements

Control statements: Statement is a line of code. Program is a set of statements. Statements execute either sequential or random. Sequential execution from top to bottom in the program. Control statements execute randomly and repeatedly …

Operators in Python

Operator: Operator is a symbol, to operate operands. Operator performs operations on one or more operands. Operands like variables, constants and functions Python divides the operators in the following way: Arithmetic Operators Comparison (Relational) Operators …

chr() and ord() in python

ord():Returns the integer for specified symbol. chr(): Return the symbol for specified integer value. Note: To understand the functionality of chr() and ord() functions, we need to know the values of ASCII character set. ASCII …

Courses Enquiry Form