Anna GE 3151 - Conditional Statements and Operators in Python

Unformatted text preview:

Conditional Statements and Operators in Python Python Interpreted Language Python is an interpreted language This means that the code is executed line by line It does not need to be compiled before execution Binary and Interpretation Not covered in these notes Dictionaries and Data Structures Not covered in these notes Print Statements in Python Not covered in these notes Loops and Jump Statements Not covered in these notes Lists and Functions Not covered in these notes Conditional Statements and Operators Conditional Statements if statement elif statement else statement Used to test if a condition is true code to be executed if condition is true if statement Syntax if condition elif statement Syntax if condition1 Used to test if a condition is true if the previous conditions were not Used to specify a block of code to be executed if all previous conditions were false code to be executed if condition1 is true elif condition2 code to be executed if condition1 is false and condition2 is true code to be executed if all conditions were false else else statement Syntax if condition1 else code to be executed if condition1 is true code to be executed if condition1 is false Conditional Operators and operator or operator not operator and operator Syntax if condition1 and condition2 or operator Syntax if condition1 or condition2 not operator Syntax Returns True if both operands are true code to be executed if both condition1 and condition2 are true Returns True if at least one of the operands is true code to be executed if condition1 or condition2 is true Returns True if the operand is false


View Full Document

Anna GE 3151 - Conditional Statements and Operators in Python

Download Conditional Statements and Operators in Python
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Conditional Statements and Operators in Python and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Conditional Statements and Operators in Python 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?