Quiz On List 7

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Quiz on list 7(3)

razwanshahad.pk@gmail.com Switch account

* Indicates required question

Email *

Record razwanshahad.pk@gmail.com as the email to be included with my response

numbers = [1, 2, 3, 4, 5] * 1 point

result = [num * 2 for num in numbers]

print(result)

[1, 4, 9, 16, 25]

[2, 4, 6, 8, 10]

[2, 4, 68, 10]

[1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
list1 = [1, 2, 3] * 1 point

list2 = [4, 5, 6]

list1.extend(list2)

print(list1)

[1, 2, 3, 4, 5, 6]

[1, 2, 3, [4, 5, 6]]

[1, 2, 3, (4, 5, 6)]

[1, 2, 3, {4, 5, 6}]

Option 5

words = ["apple", "banana", "orange"] * 1 point

result = [word.upper() for word in words]

print(result)

[“APPLE”, “BANANA”, “ORANGE”]

[“apple”, “banana”, “orange”](

[“Apple”, “Banana”, “Orange”]

[A ,B, c]
my_list = [1, 2, 3] * 1 point

my_list.clear()

print(my_list)

[]

Non

[1,2,3]

[0,0,0,]

my_list = [1, 2, 3, 4, 5] * 1 point

my_list.reverse()

print(my_list)

[1, 2, 3, 4, 5]

[5, 4, 3, 2, 1]

[5, 4, 3, 2, 1, 0]

[1, 2, 3, 4]
nums = [1, 2, 3, 4, 5] * 1 point

result = [x for x in nums if x % 2 == 0]

print(result)

[1, 2, 3, 4, 5]

[2,4]

[1,3,5]

[2,3,5]

my_list = [5, 2, 8, 1, 3] * 1 point

my_list.sort(reverse=True)

print(my_list)

[5, 2, 8, 1, 3]

[1, 2, 3, 5, 8]

[8, 5, 3, 2, 1]

[1, 3, 5, 8]
my_list = [1, 2, 3, 4, 5] * 1 point

my_list.pop()

print(my_list)

[1, 2, 3, 4]

[1, 2, 3]

[2, 3, 4, 5]

[1, 2, 3, 4, 5]

my_list = [1, 2, 3, 1,3,4,5,6,8,98,98] * 1 point

print(my_list.index(3))

words = ["apple", "banana", "orange"] * 1 point

lengths = [len(word) for word in words]

print (lengths)

[5, 6, 6]

[“apple”, “banana”, “orange”]

[0, 0, 0] (d) [1, 1, 1]

[66,44,22]
Send me a copy of my responses.

Submit Page 1 of 1 Clear form

This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy

Forms

You might also like