NEW
Font size
WorksheetsPYTHON PROGRAMMING PRELIM-EXAM
Total questions: 60
Worksheet time: 27mins
What will be the output of the following code?
A) Greater
B) Smaller
C) Error
D) None
What will be the output of the following code?
A) Greater
B) Smaller
C) Error
D) None
What will be the output of the following code?
A) Greater
B) Smaller
C) Equal
D) Error
What will be the output of the following code?
A) Greater
B) Smaller
C) Equal
D) Error
What will be the output of the following code?
A) Yes
B) No
C) Error
D) None
What will be the output of the following code?
A) Yes
B) No
C) Error
D) None
What will be the output of the following code?
A) Yes
B) No
C) Error
D) None
What will be the output of the following code?
A) Greater
B) Equal
C) Smaller
D) Error
What will be the output of the following code?
A) Both True
B) Only x is True
C) Both False
D) Error
What will be the output of the following code?
A) x is True, y is False
B) Both True
C) x is False
D) Error
What will be the output of the following code?
A) Negative
B) Zero
C) Positive
D) Error
What will be the output of the following code?
A) Negative
B) Zero
C) Positive
D) Error
What will be the output of the following code?
A) Negative
B) Zero
C) Positive
D) Error
What will be the output of the following code?
A) x is greater than y
B) x is less than y
C) x is equal to y
D) Error
What will be the output of the following code?
A) x is greater than y
B) x is less than y
C) x is equal to y
D) Error
What will be the output of the following code?
A) Even
B) Odd
C) Error
D) None
What will be the output of the following code?
A) Even
B) Odd
C) Error
D) None
What will be the output of the following code?
A) Divisible by 3
B) Not divisible by 3
C) Error
D) None
What will be the output of the following code?
A) Divisible by 3
B) Not divisible by 3
C) Error
D) None
What will be the output of the following code?
A) Positive
B) Single digit
C) Positive Single digit
D) Non-positive
What is the output of the following code?
A) Hello, World!
B) "Hello, World!"
C) None
D) Error
What will be the output of the following code?
A) 2 + 3
B) 5
C) "5"
D) Error
What is the result of calling len() on a string in Python?
A) 5
B) 6
C) 7
D) Error
What will be the output of the following code?
A) 6
B) 3
C) 2
D) Error
What will be the output of the following code?
A) 5
B) -5
C) 10
D) Error
What will be the output of the following code?
A) 4
B) 8
C) 16
D) Error
What will be the output of the following code?
A) Hello, Alice
B) "Hello, Alice"
C) Hello, "Alice"
D) Error
What will be the output of the following code?
A) 5
B) 5.0
C) 10
D) Error
What is the output of the following code?
A) Hello,
B) Hello, Guest
C) Hello, "Guest"
D) Error
What will be the output of the following code?
A) 3
B) 7
C) 10
D) Error
What will be the output of the following code?
A) 5
B) 10
C) 120
D) Error
What is the output of the following code?
A) True
B) False
C) 0
D) 1
What will be the output of the following code?
A) Hello, Alice
Hello, Bob
B) Hello, Alice Hello, Bob
C) Hello, "Alice" Hello, "Bob"
D) Error
What will be the output of the following code?
A) 15
B) [1, 2, 3, 4, 5]
C) 10
D) Error
What is the output of the following code?
A) Python
B) nohtyP
C) nohtyp
D) Error
What will be the output of the following code?
A) 3
B) 2
C) 4
D) Error
What is the output of the following code?
A) 20
B) 14
C) 9
D) Error
What will be the output of the following code?
A) Positive
B) Negative
C) Zero
D) Error
What will be the output of the following code?
A) JD
B) J D
C) John Doe
D) Error
What is the output of the following code?
A) [0, 1, 1, 2, 3]
B) [0, 1, 2, 3, 4]
C) [0, 1, 1, 2, 3, 5]
D) Error
What will be the result of the expression len('Python')?
5
6
7
error
What does the expression 4 ** 2 evaluate to?
A) 16
B) 8
C) 4
D) 2
What is the value of the expression not (True or False)?
A) True
B) False
C) 1
D) 0
What will be the result of the expression 10 // 3?
A) 3
B) 3.33
C) 4
D) 1
What is the value of the expression True and False?
A) True
B) False
C) 1
D) 0
What does the expression 5 >= 5 evaluate to?
A) True
B) False
C) None
D) Error
What is the value of the expression 4 != 4?
A) True
B) False
C) None
D) Error
What will be the result of the expression 5 == 5.0?
A) True
B) False
C) None
D) Error
What will be the output of the following expression: 'A' < 'a'?
A) True
B) False
C) None
D) Error
What will be the result of the expression 'Hello' + ' ' + 'World!'?
A) HelloWorld!
B) Hello World!
C) Hello + World!
D) HelloWorld!
What will be the output of the following expression: 2 + 3 * 5?
A) 25
B) 17
C) 13
D) 10
What is the value of the expression 7 % 3?
A) 1
B) 2
C) 3
D) 4
What does the expression -5 + 3 evaluate to?
A) -8
B) -2
C) 2
D) -5
What does the expression 3 > 2 and 2 < 5 evaluate to?
A) True
B) False
C) None
D) Error
What is the result of the expression int('10') + float('20.5')?
A) 30.5
B) 205.0
C) 1020.5
D) Error
What will be the output of the following expression: 3 + 4 2 / (1 - 5) * 2?
3.5
3.125
2.5
2.75
What does the expression round(2.678, 2) evaluate to?
2.67
2.68
2.67.8
3
What will be the output of the following expression: list(range(0, 10, 2))?
[0, 2, 4, 6, 8]
[0, 2, 4, 6, 8, 10]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[2, 4, 6, 8]
What does the expression {'a': 1, 'b': 2}.get('c', 3) evaluate to?
1
2
3
none
What will be the result of the expression 'Python'[::-1]?
Python
nohtyP
Error
Pnohty
