What is the output of the following print() statement?
print()
print(“Borussia”, “Dortmund”)
Borussia Dortmund
Which of the following casting operations result in the Boolean value True?
True
Note: There are 2 correct answers to this question.
bool("False")
bool(0)
bool(2-2)
bool(1)
bool(int("0"))
Which of the following conditions are True?
Note: There are 3 correct answers to this question.
"a" and True
2 == 2.0
1 and True
"a" == True
2 == True
What does the expression (x % 5 == 0) and (x % 7 == 0) mean?
(x % 5 == 0) and (x % 7 == 0)
x is divisible by 5 or 7
x is divisible by either 5 or 7 (but not both)
x is divisible by neither 5 nor 7
if x is equal to 105, then the expression is True
x is divisible by 5 and divisible by 7
What is the result of the following operation 9 // 4?
9 // 4
2
What does the abbreviation "IPO" stand for?
Input Processing Output
Which function is used to get user input into a program?
input()
hich of the following are data types in Python?
Integer
Time
Boolean
String
Name
Which of the following Boolean expressions is True?
17 > 10
25 == "25"
(25 > 100) or (25 < 100)
(25 < 100) and (25 > 100)
not(100 < 99)
Which of the following statements about the syntax of the if-else statement are correct?
if-else
Each if-statement requires the else-part. An if without an else leads to an error.
The code block (the one belonging to the if- or else-part) needs to be indented.
The evaluation of the condition can have exactly two values: True or False.
There must be at least one conditional statement. No statement behind the if and continuing directly with the else leads to an error.
To make the program more readable, you can use indention wherever you like.
True or False
True and True
True and False
not(False)
not(not(False)
Which of the following statements about if-statements are correct?
There can be either elifs or nesting. Both elif and nesting in one if-statement is forbidden.
elif
According to the syntax of Python, the amount of nesting is not limited.
Even though many levels of nesting are syntactically correct, too much nesting should be avoided to keep a program readable and maintainable.
Conditions can have more than two outcomes.
The number of elifs in an if-statement is limited.
If a and b are two Boolean variables and a is True and b is False, which of the following expressions is True?
a
b
False
a or b
not(a or b)
a and b
not(a) and not(b)
Last changed2 years ago