4 is 100 in binary and 11 is 1011. What is the output of the following bitwise operators?
a = 4
b = 11
print(a | b)
print(a >> 2)
UNIT2&3 PYTHON QUIZ
Quiz
•
Computers
•
KG - University
•
Hard
Humera I
Used 6+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
4 is 100 in binary and 11 is 1011. What is the output of the following bitwise operators?
a = 4
b = 11
print(a | b)
print(a >> 2)
15 1
14 1
13 1
15 0
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the expression print(-18 // 4)
-4
5
-5
4
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of print(2 * 3 ** 3 * 4)
512
216
864
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following assignment operator?
x=2
y = 10
x +=y+ 2
print(x)
12
13
14
15
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code
print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))
True True False True
False True False True
True True False True
False True True True
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following Python code
x = 10
y = 50
if (x ** 2 > 100 and y < 100):
print(x, y)
100 500
None
10 50
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following addition (+) operator
a = [10, 20]
b = a
b += [30, 40]
print(a)
print(b)
[10, 20, 30, 40]
[10, 20, 30, 40]
[10, 20]
[10, 20, 30, 40]
20 questions
Subroutines - Procedures & Functions
Quiz
•
9th - 12th Grade
21 questions
Python Strings
Quiz
•
11th Grade
20 questions
Python - lists,loops,basics
Quiz
•
9th - 11th Grade
22 questions
c++
Quiz
•
University
20 questions
Basics Python
Quiz
•
8th - 10th Grade
21 questions
Unit 09 - QBASIC
Quiz
•
6th Grade
20 questions
Python String
Quiz
•
12th Grade
25 questions
Python Quiz
Quiz
•
University - Professi...
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade