python functions

python functions

University

14 Qs

quiz-placeholder

Similar activities

Python revision

Python revision

10th Grade - University

15 Qs

SCRIPTING PROGRAMMING WITH PYTHON

SCRIPTING PROGRAMMING WITH PYTHON

University

15 Qs

The Ruby Erudite Saga Quiz

The Ruby Erudite Saga Quiz

University

9 Qs

GRADE 10 ТЖБ

GRADE 10 ТЖБ

University

9 Qs

PROGRAMMING IN PYTHON - UNIT II - TEST 2 - MCQS

PROGRAMMING IN PYTHON - UNIT II - TEST 2 - MCQS

University

15 Qs

CMP128 Java Ch. 05 Methods

CMP128 Java Ch. 05 Methods

University

10 Qs

J277 - 2.2 - Functions in Python

J277 - 2.2 - Functions in Python

10th Grade - University

10 Qs

Functions in Python

Functions in Python

University

10 Qs

python functions

python functions

Assessment

Quiz

Computers

University

Medium

Created by

Geeta Gupta

Used 4+ times

FREE Resource

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the following code output?

11, 9

16, 16

None, None

225, 117

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct code to define a function?

def area ( ):

area ( )

def area:

def area ( )

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image
How do you correctly call this function
def(1)
x=square( )
defSquare(4)
x=square(5)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword marks a spot in a function where the program flow will go back to the calling code?

break

return

continue

jump

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many return statements can you place inside one function body?

As many as needed; each marks a spot where program flow returns to the calling code

You can have one return statement per parameter that is defined by the function "def"

You are limited by the number of body statements, divided by 2

Exactly one

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What controls a variable's scope?

The location where it is first initialized within your code

The comment you place to the right of the variable name

The capitalization you select for the letters in your function name

The length of your variable name

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following rules is true about locally scoped variables?

Local variables can hold less data than global variables

Local variables can be seen and accessed from any part of the program code

Local variables will keep their same value over repeated calls to the function

Local variables can only be seen and used from inside a function

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?