Python quiz

Python quiz

10th Grade - Professional Development

10 Qs

quiz-placeholder

Similar activities

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

Streams

Streams

Professional Development

10 Qs

Computational Thinking in Python[Quiz 3]

Computational Thinking in Python[Quiz 3]

University

15 Qs

Produktif C2 Pertemuan ke - 2

Produktif C2 Pertemuan ke - 2

10th Grade

10 Qs

ICT Unit Test Topic : DBMS - Access

ICT Unit Test Topic : DBMS - Access

8th - 12th Grade

15 Qs

TIN HỌC 10 - BÀI 21

TIN HỌC 10 - BÀI 21

10th Grade

10 Qs

Python Quiz 1.4

Python Quiz 1.4

University

12 Qs

Python quiz

Python quiz

Assessment

Quiz

Computers

10th Grade - Professional Development

Practice Problem

Hard

Created by

Viraj Yeotikar

Used 26+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which one is NOT a legal variable name?

my_var

Myvar

_myvar

my-var

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the correct syntax to output the type of a variable or object in Python?

print(typeof(x))

print(type(x))

print(typeof x)

print(typeOf(x))

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which method can be used to remove any whitespace from both the beginning and the end of a string?

ptrim()

len()

strip()

trim()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A while loop in Python is used for what type of iteration?

indefinite

discriminant

definite

indeterminate

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these collections defines a LIST?

["apple", "banana", "cherry"]

{"apple", "banana", "cherry"}

("apple", "banana", "cherry")

{"name": "apple", "color": "green"}

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code snippet:


a = ['foo', 'bar', 'baz', 'qux', 'corge']

while a:

if len(a) < 3:

break

print(a.pop())

print('Done.')

corge

qux

baz

corge

qux

baz

Done.

The snippet doesn’t generate any output.

corge

qux

baz

bar

foo

Done.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Will the print() statement on line 5 be executed in this case:


a = ['foo','bar','baz','qux','corge']

while a:

print(a.pop())

else:

print('Done.')

No

Yes

Create a free account and access millions of resources

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?

Discover more resources for Computers