False
As (a <= x) and (x < b).
bool
The 'and' operator has higher precedence than 'or'.
It determines the block of code that belongs to a conditional statement.
A number.
It prints 'Y is zero.'
Less than 80 characters.
To execute statements only if certain criteria are satisfied.
input()
False.
A test expression and a body.
Boolean (bool).
True or False.
You get a B+.
Either True or False.
False.
int, float, string.
<, <=, >, >=, ==, !=.
The year isn't a leap year!
False.
or.
An expression formed by comparison or logical operations.
A run-time error will occur.
To prevent a run-time error during division.
Evaluates to True if i is less than j, otherwise False.
An expression that can consist of sub-expressions combined using logical operators.
Control flow determines the order in which individual statements, instructions, or function calls are executed.
The boolean data type represents two values: True and False.
Mixing '=' with '=='.
(17 x + 3 >= 9) or (z != (x * 2) and not(y / 2 < 3))
The spaces at the beginning of a code line.
It negates the result of the expression that follows it.
Template files tend to have more levels of nesting.
The year is a leap year!
Integer input.
Code written at the same indentation level.
It is a positive odd number.
Operators used to compare values, such as ==, !=, <, >, <=, and >=.
**.
Boolean (bool), either True or False.
Evaluates to True if i is greater than j, otherwise False.
It represents the idea more naturally and clearly.
Executes the body if the test expression is true.
>= and !=
It will give an error.
By combining conditions into a single if statement.
Four spaces.
The year to be checked.
To indicate a block of code.
When expr1 is false, making the whole expression false.
By avoiding unnecessary evaluations of sub-expressions.
It is a positive even number.
The indentation must be the same.
6 floating point numbers corresponding to the (x, y) coordinates of the triangle's corners.
B+.
not
It evaluates to the negation of whether y divided by 2 is less than 3.
Indentation is used to define the scope of loops, functions, and conditionals in Python.
Expressions in that block are evaluated.
Parentheses.
Logical NOT.
An expression has a value and a type.
The value of x divided by y.
The statement is skipped.
All statements are executed one-by-one.
Whether y is not equal to 0.
Only if the test expression evaluates to true.
True
This is a triangle!
if test_expression_TE: body_to_be_executed_if_TE_is_true else: body_to_be_executed_if_TE_is_false.
To check if three given lengths can form a triangle.
Executes the body if the test expression is false.
Print 'Even'.
No, it can't be empty.
It prevents division by zero by checking 'count != 0' first.
To determine whether a statement should be executed based on a condition.
It checks if 'y' is equal to 0.
Only one if-statement body is executed.
To perform branching based on a test expression.
and (AND), or (OR), and not (NOT).
The code will not execute the division statement.
a + b > c, b + c > a, and c + a > b.
if test_expression: followed by the body.
Branching allows the program to take different paths based on conditions.
Tests for equality; True if i is the same as j.
They clarify the order of operations and precedence.
That no actions should be done.
Dangling 'else' problem.
The pass statement is executed, and no action is taken.
The result of 'y / 2' is being compared to 3.
If x is even (x % 2 == 0).
and.
The order of the sub-expressions.
and, or
The spaces at the beginning of a code line.
A warning letter.
It checks if the mark is between 70 and 75.
Whether 'scores / count' is less than 60 and 'count' is not zero.
A leap year is divisible by 4, but not divisible by 100, unless it is divisible by 400.
The program calculates and prints the value of x divided by y.
True.
True.
Variable names with Boolean values.
Excessive use of blank lines.
It will execute if y is not equal to 0.
By relying on indentation (the number of white spaces at the beginning of a line).
Checks if i is greater than or equal to j.
False
False
Short-circuit evaluation is a programming technique where the second argument is evaluated only if the first argument does not suffice to determine the value of the expression.
To simplify some program code.
Print 'Odd'.
To allow the program to choose only one of two alternatives.
*, /, %, //, +, −.
Sub-expressions in a test expression are not evaluated if the value of the entire expression is already known.
Logical operations on bools.
True or False.
A block of code that executes multiple actions when the test expression is true.
Integer input.
15
By using indentation.
True.
Boolean values (bool).
This is NOT a triangle!
No, they are not the same.
To determine when one line of code is connected to the line above it.
Whether the number is even or odd.
A composed set of several statements to be executed when a certain condition is met.
If x is greater than 0.
A block of code.
If the variable y is zero.
8
False
The input number y is either equal to zero (y == 0 is true) or not equal to zero (y != 0 is true).
Checks if i is less than or equal to j.
(((x + 3) >= 9) or ((z != (x * 2)) and (not((y / 2) < 3))))
Indicates inequality; True if i is not the same as j.
An if/else statement allows the program to execute one block of code if the condition is True and another block if it is False.
Logical operators are used to combine conditional statements.
An if-statement executes a block of code if its condition evaluates to True.