Python Course – while loop
In Python while loop is used when a certain block is to be executed until the condition in while statement is true. A loop become infinite if the condition never becomes false.
In Python while loop is used when a certain block is to be executed until the condition in while statement is true. A loop become infinite if the condition never becomes false.
In Python decisions are made with if statements also called as selection statement. The if block statements are executed if the conditions are ‘true’. In case of false condition, the else block is executed.
Python for loop is used for iteration of a sequence. for loop continues the iteration till the sequence is ended.
In Python continue keyword skips that loop iteration and move on with the next line of iteration. It doesn’t end the loop but skips that particular condition or line of code.
In Python, break statement is used to end the iteration and move on to the next block of code.
Python “and” statement work on logical factors and is also a part of Boolean Algebra. Python and is a logical operator, and is used to combine conditional statements and gives the output in true or false.
Pass statement is used to ignore a block and move forward without any execution of the operation. It is basically a null statement. Pass is used to avoid compilation errors.
Bitwise operators work on bits. The integers are converted into binary and then the operations are performed on bits by bits. The output comes in the decimal form.
Logical operator work on logics such as AND, OR, NOT, etc. Python has many logical operators and the result is always boolean value i.e. true or false.
Comparison operators in Python is used to compare two values and return boolean result.