Search Header Logo

python set 1

Authored by ESPARK 2023

Other

University

Used 6+ times

python set 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Amongst which of the following if syntax is true?

if condition: #Will executes this block if the condition is true

if condition { #Will executes this block if the condition is true }

if(condition) #Will executes this block if the condition is true

None of the mentioned above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one of the following is not a keyword in Python language?

eval

assert

nonlocal

pass

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What arithmetic operators cannot be used with strings in Python?

*

+

All of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is the definition for packages in Python

A set of programs making use of Python modules

A set of main modules

A folder of python modules

A set of programs making use of Python modules

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

a = [1, 2, 3, 4]

b = [3, 4, 5, 6]

c = [x for x in a if x not in b]

print(c)

[1,2]

[5,6]

[1,2,5,6]

[3,4]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet?

a = [[], "abc", [0], 1, 0]

print(list(filter(bool, a)))

[abc]

['abc',[0],1]

[1]

none of above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code snippet?

pYHON PrOgRaMmInG

Python Programming:

PYTHON PROGRAMMING

python programming

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?