Python Workshop 4 Review

Python Workshop 4 Review

University

10 Qs

quiz-placeholder

Similar activities

Exam 1 Practice

Exam 1 Practice

University

15 Qs

Alabi, Kolade, CSCI-2380-01P, PRE

Alabi, Kolade, CSCI-2380-01P, PRE

University

15 Qs

C++ vs Python: A Quiz Introduction

C++ vs Python: A Quiz Introduction

11th Grade - University

10 Qs

Python with DataScience

Python with DataScience

7th Grade - University

10 Qs

Python Programming Basics

Python Programming Basics

University

14 Qs

python functions

python functions

University

14 Qs

PROGRAMMING IN PYTHON - UNIT II - TEST 1 MCQS

PROGRAMMING IN PYTHON - UNIT II - TEST 1 MCQS

University

15 Qs

Quiz3_DivideConquer_GreedyApproach

Quiz3_DivideConquer_GreedyApproach

University

10 Qs

Python Workshop 4 Review

Python Workshop 4 Review

Assessment

Quiz

Computers

University

Hard

Created by

Logan Dane

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the output of this Python code?

for x in range(0,2):

for y in range(0,2):

print("loop run")

loop run loop run loop run loop run
loop run loop run loop run
loop run loop run
loop run

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the output of this Python code?

arr = [“red”, “blue”, “green”]

for x in arr:

print(x)

green

blue

red

red blue
red blue green
red

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What keyword do you use to define a function in Python?

class
def
function
var

4.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What reason is there to use functions in your code?

To increase the chances of bugs and errors in the code.
To make the code more complicated and difficult to understand.
To reuse code and improve code organization.
To waste time and make the code less efficient.

5.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the proper structure of a function in Python?

def function_name():
function_name():
function def():
def function_name:

6.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the structure for using parameters in a function in Python?

Parameters are defined within the curly braces of a function in Python.
Parameters are defined within the brackets of a function in Python.
Parameters are defined within the square brackets of a function in Python.
Parameters are defined within the parentheses of a function in Python.

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What does a return statement do in Python?

A return statement in Python is used to exit a loop and return a value.
A return statement in Python is used to print a value.
A return statement in Python is used to exit a function and return a value.
A return statement in Python is used to define a variable.

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?