Search Header Logo

Python Programming Quiz - 2

Authored by Krishnesh G P

Engineering

12th Grade

Python Programming Quiz - 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct variable declaration in Python?

int x = 5

var x = 5

x = 5

declare x = 5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type is returned by the expression 3 + 2.5 in Python?

Integer

Float

String

Boolean

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used for exponentiation in Python?

^

**

%

//

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a mutable data type in Python?

String

Tuple

List

Integer

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? python Copy code a = 10 b = 20 a, b = b, a print(a, b)

10 10

10 20

20 10

20 20

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used to create a conditional statement in Python?

if

for

while

switch

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? python Copy code x = 5 if x > 2: print("A") elif x > 4: print("B") else: print("C")

A

B

C

No output

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?