Python Quiz 1

Python Quiz 1

Professional Development

10 Qs

quiz-placeholder

Similar activities

Basic of Programming - Quiz 02

Basic of Programming - Quiz 02

University - Professional Development

15 Qs

aXQtMjktMTEtMjAyMg==

aXQtMjktMTEtMjAyMg==

Professional Development

10 Qs

Python Module 1

Python Module 1

University - Professional Development

13 Qs

Day 2

Day 2

Professional Development

10 Qs

codePannu  Level 1 Python Course - Week 6 Quiz on Logical Operators

codePannu Level 1 Python Course - Week 6 Quiz on Logical Operators

Professional Development

15 Qs

Java Lesson 2

Java Lesson 2

KG - Professional Development

7 Qs

INTRODUCTION TO PYTHON

INTRODUCTION TO PYTHON

Professional Development

10 Qs

Computer Quiz

Computer Quiz

5th Grade - Professional Development

8 Qs

Python Quiz 1

Python Quiz 1

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Thomas Sheeba

Used 13+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following

aList = [5, 10, 15, 25]

print(aList[::-2])

· [15, 10, 5]

· [10, 5]

[25,10]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following

aList = [1, 2, 3, 4, 5, 6, 7]

pow2 = [2 * x for x in aList]

print(pow2)

· [2, 4, 6, 8, 10, 12, 14]

· [2, 4, 8, 16, 32, 64, 128]

· [2, 4, 8, 16, 32, 64]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code

my_list = ["Hello", "Python"]

print("-".join(my_list))

HelloPython-

Hello-Python

-HelloPython

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Select all the correct options to copy a list

aList = ['a', 'b', 'c', 'd']

· newList = copy(aList)

· newList = aList.copy()

· newList.copy(aList)

· newList = list(aList)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

sampleList = [10, 20, 30, 40]

del sampleList[0:6]

print(sampleList)

· []

· list index out of range.

· [10, 20]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following list operation

aList = [10, 20, 30, 40, 50, 60, 70, 80]

print(aList[2:5])

print(aList[:4])

print(aList[3:])

·[20, 30, 40, 50]

[10, 20, 30, 40]

[30, 40, 50, 60, 70, 80]

[30, 40, 50]

[10, 20, 30, 40]

[40, 50, 60, 70, 80]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following list comprehension

resList = [x+y for x in ['Hello ', 'Good '] for y in ['Dear', 'Bye']]

print(resList)

[‘Hello Dear’, ‘Hello Bye’, ‘Good Dear’, ‘Good Bye’]

[‘Hello Dear’, ‘Good Dear’, ‘Hello Bye’, ‘Good Bye’]

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?