NEW
Font size
WorksheetsCodeHS Computer Science Principles
Total questions: 26
Worksheet time: 52mins
________ allow us to break our programs into smaller parts
decisions
functions
methods
loops
Which is the correct header of a function names double_number that takes one parameter
def double number (x)
def double_number(x)
def double_number(x):
def double_number(int x):
Everything in a function is indented by _____
One Level
Two Levels
Three Levels
In Curly Brackets ({})
To call a previous written function, you use the
function return type
function name without the ()
function name with () and included parameters
function name with ()
The tasks included in a function definition are referred to as the function _______.
method
body
statements
parameters
The variables written inside the () of a functions definition are the _____
return types
arguements
variables
parameters
When functions have multiple parameters, the variables are separated with
commas
colons
simi-colons
periods
True or false. Parameters can have default values?
True
False
Parameters with default values have to come at the _____ of the parameters in the function
beginning
middle
end
Incorrectly writing a default parameter in a function definition will result in ....
a logic error where the program still runs, but incorrectly.
a syntax error, non-default argument follows default argument
a syntax error, incorrect function declaration
a syntax error, incorrect variable declaration in function
When a value from a function is passed back to the function call, it is referred to as a _____
return value
send back value
argument
parameter
They keyword used to tell a function to send the variable value back to where it was called
send
go
return
parameter
True or False. Functions can not call other functions.
True
False
Which python statement allows you to save the return value from a function inside a variable?
return element
print(function_name())
variable = function_name()
function_name()
Which python statement allows you to print the return value from a function
return element
print(function_name())
variable = function_name()
function_name()
Which is correct?
Functions take in parameters and give back results called return values
Parameters take in functions and give back results called return values
Return types take in functions and give back results called parameters
Functions take in return values and give back results called parameters
A _____ is the collection of variable names that exist at a certain point in your code
Scope
Local Scope
Global Scope
Namespace
____ refers to where the variable exists within a program.
Scope
Local scope
Global scope
Namespace
When a variable is defined in a function it is in
The functions local scope
The global scope of the program
Everywhere below that line
In the entire namespace
Every programming language has a ______
API
Karel API
Standard Library
Functions
A _____ is a set of tools for building programs
Application Programming Interface
A-frame Pixel Interface
Assistant Program Information
Abstract Programming Interface
True or False. Karel is an example of an API.
True
False
A good API __________ complex details involved in getting the program to work
hides
gets rid of
abstracts away
deletes
________ provides information to show programmers how to use an API
Comments
The orginal code
Documentation
Commands
Companies like Twitter, Facebook and Spotify provide an API for other programs to ______
use their applications
interact with their site and their data
make it hard to connect the applications
see how the site was created
Which is an example of an API we see today
Tweeting from the twitter webpage
Posting a status update on Facebook
Uploading a photo to Instagram
Adding a Spotify music player on your own webpage
