click below
click below
Normal Size Small Size show me how
Python Beginners 2
Arithmetic Operations, Operator Precedence, Math Functions, If Statements, etc.
Question | Answer |
---|---|
When dividing in Python, which division operator is used to receive an integer number? | // |
What is a modulus operator? | % |
What is the exponent operator? | ** |
What does the modulus operator do? | It returns the remainder of the division |
What does the exponent operator do? | It returns the power |
How do you increment a number in Python? | X = X + (number) |
What is an augmented assignment operator? | A way to write code in a shorter form |
Using Python operator precedence, what is the answer for x = 10 + 3 * 2? | 16 |
What is Exponentiation? | The power |
What is the solution for: x = (2 + 3) * 10 - 3 | 47 |
What is the abs function? | The Absolute Function |
Which function always returns a positive number? | The Absolute Function |
In Python, what allows us to build programs based on some conditions? | If Statement |
What is used in an "if" statement to add a second option? | else Statement |
What is an additional else statement? | elif Statement |
What operator is used in situations where there are multiple conditions? | Logical Operator |
Is it true or false that if you have an "and" logical statement and one of the conditions is False, a message will be returned? | False |
Is it true or false that if you have an "or" logical statement and one of the conditions is False, a message will be returned? | True |
Besides "and" and "or", what is another logical operator? | not |
What operator is used to compare a variable with a value? | Comparison Operator |
What is used to execute a block of code multiple times and to build interactive programs and games? | While Loops |
What statement terminates the nearest enclosing loop? | break Statement |