Python Quiz

Python Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Python Boolean

Python Boolean

11th - 12th Grade

11 Qs

Post-Break Python Refresher

Post-Break Python Refresher

9th - 12th Grade

20 Qs

Python - List and Tuples

Python - List and Tuples

11th - 12th Grade

20 Qs

ASK F2 -KOD ARAHAN (PYTHON)

ASK F2 -KOD ARAHAN (PYTHON)

1st Grade - University

15 Qs

Computer Science LISTS

Computer Science LISTS

12th Grade

18 Qs

list in python

list in python

10th - 12th Grade

15 Qs

Python_2R

Python_2R

KG - Professional Development

20 Qs

Python Basics - yr 9

Python Basics - yr 9

9th - 12th Grade

18 Qs

Python Quiz

Python Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Sarika Kaushal

Used 29+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

How to create a single element tuple

(1,)

(1)

{1}

[1]

tuple([1])

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Result of the program above is

('1', '2', '3', '4', '5')

(1, 2, 3, 4, 5)

12345

"12345"

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the “hello” +1+2+3?

hello123

hello

hello6

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('yy'))

2

0

5

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose t = (1, 2, 4, 3), which of the following is incorrect?

print(t[3])

t[3] = 45

print(max(t))

print(len(t))

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

>>>t=(1,2,4,3)

>>>t[1:-1]

(1, 2)

(1, 2, 4)

(2, 4)

(2, 4, 3)

7.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Assume the following list definition:


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


Several short REPL sessions are shown below. Which display correct output?

>>> print(a[-6])

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

IndexError: list index out of range

>>> a[:] is a

True

>>> print(a[4::-2])

['quux', 'baz', 'foo']

>>> print(a[-5:-3])

['bar', 'baz']

>>> max(a[2:4] + ['grault'])

'qux'

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?