Search Header Logo

list sort and concatenation

Authored by Jumanah Alqurnah

Computers

12th Grade

Used 5+ times

list sort and concatenation
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following Python code print the list X in a reverse order

a) print(X.reverse ())

b) X.sort(reverse= FALSE)

print(X)

c) print(X[: : -1])

d) b and c.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following Python code sort the list X in an ascending order:

sort.X( )

X.sort[ ]

X.sort(reverse = True)

X.sort( )

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following python code adds the List 1 as an extension to the original List 2

a) List1.extend(List2)

b) List2.extend(List1)

c) List1.append(List2)

d) a and c.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Let x= "17" and y=["My age is"], the output of print(x + y) is ["My age is", "17"]

True

False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following Python code sort the list x in an descending order:

x.reverse ( )

x.sort( )

x.sort(key = len)

x.sort(reverse = True)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

let x = [2,5,0,8,9], the output of the following Python code is

x.reverse( )

print(x[0])

x.sort(key=len)

print(x)

9

Error

2

[9, 8, 0,5,2]

9

[0, 2, 5, 8, 9]

2

[0, 2, 5, 8, 9]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

let x= ["my name is"] and y = "Ali", which of the following Python code will print my name is Ali as a string

print(x +[ y ])

print(str(x) + y)

Access all questions and much more by creating a free account

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?