Search Header Logo

Python Functions and Data Structures Quiz

Authored by EC M

Other

University

Used 1+ times

Python Functions and Data Structures Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'greet' function in Python?

To greet a person

To add two numbers

To create a list

To install a package

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command is used to install packages in Python?

pip install

setup

import

install

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the 'add' function return when called with arguments 5 and 3?

3

15

5

8

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to create a DataFrame using Pandas?

df = DataFrame.create(data)

df = new DataFrame(data)

df = create.DataFrame(data)

df = pd.DataFrame(data)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the command 'greet()' output if no name is provided?

Hello, Guest!

Hello, Alice!

Hello, Charlie!

Hello, Bob!

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data structure is used to represent a matrix in Python?

DataFrame

Numpy array

Array

List

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of 'print(df[df["Age"]>30])' given the DataFrame?

All people

People younger than 30

People older than 30

No one

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?