Search Header Logo

UNIT2&3 PYTHON QUIZ

Authored by Humera I

Computers

KG - University

Used 6+ times

UNIT2&3 PYTHON QUIZ
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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]

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?