Python Round 2

Python Round 2

University

10 Qs

quiz-placeholder

Similar activities

Intro to Data Mining

Intro to Data Mining

University

15 Qs

JAVA - Arrays

JAVA - Arrays

University - Professional Development

15 Qs

OS(II UNIT)

OS(II UNIT)

University

15 Qs

Microsoft Word Quiz

Microsoft Word Quiz

University

15 Qs

Week 4

Week 4

University

15 Qs

Software Engineering :TEST 2

Software Engineering :TEST 2

University

10 Qs

Logic Based Testing

Logic Based Testing

University

15 Qs

Data Structures: Linked Lists and Hashtables

Data Structures: Linked Lists and Hashtables

11th Grade - University

14 Qs

Python Round 2

Python Round 2

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Noor Malik

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

1 min • 2 pts

How do you print the length of a list named `my_list` in Python?

 

print(length(my_list))

print(len(my_list))

print(my_list.length())

2.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What does the `range(5)` function return?

A list containing [0, 1, 2, 3, 4]

A list containing [1, 2, 3, 4, 5]

A list containing [5, 4, 3, 2, 1]

3.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

How do you concatenate two lists `list1` and `list2` in Python?

list1 + list2

concatenate(list1, list2)

list1.concat(list2)

4.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the output of the following code?

    ```python

    my_string = "Hello, World!"

    print(my_string[7:])

    ```

Hello

  World!

    , World!

5.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

How do you sort a list `my_list` in ascending order?

sorted(my_list)

my_list.sort()

sort(my_list)

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the output of the following code?

    ```python

    def my_func(x, y):

        return x + y

    print(my_func(2, 3))

    ```

 

5

23

2 + 3

7.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the purpose of the `lambda` keyword in Python?

To define a new variable

To define a new function

To define a new class

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?