CONDITIONAL STATEMENTS IN PYTHON
CONDITIONAL STATEMENTS
IN PYTHON
Peter Larsson-Green
J?nk?ping University
Autumn 2018
CONDITIONAL STATEMENTS
Enter a number: 12
Enter a number: -12
That is a positive number!
That is a negative number!
BOOLEANS
? Used to represent something's correctness.
? Possible values: True and False.
Examples
True
True
¡ú True
False
False
¡ú False
RELATIONAL EXPRESSIONS
Syntax:
How it is computed
1. Evaluate .
2. Evaluate .
3. Apply on
the computed values.
Examples
3 < 5
3< 5 ¡ú 3 < 5
¡ú 3 < 5 ¡ú True
3 > 5
3> 5 ¡ú 3 > 5
¡ú 3 > 5 ¡ú False
3 == 2
3 == 2 ¡ú 3 == 2
¡ú
3 == 2
¡ú False
3 != 2
3 != 2 ¡ú 3 != 2
¡ú
3 != 2
¡ú True
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- python selection if else basic selection statement
- conditional looping constructs
- conditional statements in python
- python conditional statements
- python if else rxjs ggplot2 python data persistence
- computer science 1000 part 7 programming in python p l
- chapter 3 control statements
- unit 3 boolean expressions if statements python tutorial
- if statements and booleans
- nested ifs if and if or teach ict
Related searches
- conditional statements verilog
- conditional statements and equivalence
- conditional statements and equivalence quiz
- conditional statements venn diagram worksheet
- conditional statements quizlet
- multiple return statements in python function
- conditional statements in word
- multiple conditional statements in excel
- conditional statements and equivalence quizlet
- conditional statements examples
- conditional statements geometry definition
- conditional statements geometry pdf