Python list and tuple

Python list and tuple

6th - 8th Grade

10 Qs

quiz-placeholder

Similar activities

PENGENALAN PERANGKAT LUNAK PENGOLAH ANGKA

PENGENALAN PERANGKAT LUNAK PENGOLAH ANGKA

8th Grade

10 Qs

Arduino

Arduino

7th - 9th Grade

15 Qs

Primary: Flowcharts

Primary: Flowcharts

5th - 6th Grade

6 Qs

MinecraftPython Test 1

MinecraftPython Test 1

5th - 6th Grade

9 Qs

Redes Sociales y su impacto

Redes Sociales y su impacto

1st - 9th Grade

13 Qs

Explore Scratch 3: Motion and Pen

Explore Scratch 3: Motion and Pen

3rd Grade - University

10 Qs

Class 6-Concepts of Image Editing

Class 6-Concepts of Image Editing

6th Grade

10 Qs

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

Python list and tuple

Python list and tuple

Assessment

Quiz

Computers

6th - 8th Grade

Hard

Created by

Sahana Karunakar

Used 181+ 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

30 sec • 1 pt

What will be the output?

var1=['sam', "Pam", 12,44]

var1[3]="Ram"

print(var1)

['sam', 'Pam', 12, 44]

['sam', 'Pam', 12, 'Ram']

It will give an error

['sam', 'Pam', 'Ram',44]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output?

tuple1=['sam', "Pam", 12,44]

print(type(tuple1))

<class 'list'>

<class 'tuple'>

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output?

list1=['sam', "Pam", 12,44]

print(list1[-1])

12

sam

No such index in the list

44

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output?

list1=["Red","Green","Blue","Yellow"]

list1.append("Black")

print(list1)

<class 'list'>

['Red', 'Green', 'Blue', 'Yellow', 'Black']

['Black','Red', 'Green', 'Blue', 'Yellow' ]

AttributeError: 'tuple' object has no attribute 'append'

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the statements are true for the code below:


list1=["Red","Green","Yellow","Orange","Black"]


if "Red" in list1 and "Green" in list1 and "Yellow" in list1:

print("We have all the colors of traffic lights")

Print statement will be executed if the list has red/yellow/Blue

Print statement will be executed if the list has all the three colors

It will give syntax error

None of these

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output?

list1=["Red","Green","Yellow","Orange","Black","Emerald blue"]


print(max(list1))

Emerald blue

Black

Red

Yellow

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

list1=["Red","Green","Yellow","Orange","Black","Emerald blue"]

list1.sort()

print(list1)

["Red","Green","Yellow","Orange","Black","Emerald blue"]

Not a valid function in Python3

['Black', 'Emerald blue', 'Green', 'Orange', 'Red', 'Yellow']

None

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?