Python - Functions

Python - Functions

University

11 Qs

quiz-placeholder

Similar activities

SITASI - MD 1C

SITASI - MD 1C

University

10 Qs

Maya Angelou

Maya Angelou

2nd Grade - Professional Development

10 Qs

National Education Policy.

National Education Policy.

University

10 Qs

KUIS PKKMB IBLAM DAY 1

KUIS PKKMB IBLAM DAY 1

University

15 Qs

THE LEGAL BASIS OF THE PHRASE "I LOVE ANIMALS"

THE LEGAL BASIS OF THE PHRASE "I LOVE ANIMALS"

University

10 Qs

Fundamental Rights

Fundamental Rights

6th Grade - University

10 Qs

Tọa đàm PTDL và tương lai của PTDL trong Kỷ nguyên số

Tọa đàm PTDL và tương lai của PTDL trong Kỷ nguyên số

University

7 Qs

Civil Engineering Material Chapter 1 & 2

Civil Engineering Material Chapter 1 & 2

University

10 Qs

Python - Functions

Python - Functions

Assessment

Quiz

Education

University

Practice Problem

Medium

Created by

Teaching Assistant Ivy

Used 54+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a feature of DocString?

Provide a convenient way of associating documentation with Python modules, functions, classes, and methods

All functions should have a docstring

Docstrings can be accessed by the __doc__ attribute on objects

All of the mentioned

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which are the advantages of functions in python?

Reducing duplication of code

Decomposing complex problems into simpler pieces

Improving clarity of the code

All of the mentioned

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the two main types of functions?

Custom function

Built-in function & User defined function

User function

System function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Where is function defined?

Module

Class

Another function

All of the mentioned

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is called when a function is defined inside a class?

Module

Class

Another function

Method

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following refers to mathematical function?

sqrt

rhombus

add

rhombus

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?

def cube(x):

return x * x * x


x = cube(3)

print (x)

9

3

27

30

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

Already have an account?