code hs functions and parameters quiz

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

what is the meaning of the x variable?

the x position of the center circle

2
New cards

the following program should draw a circle on the screen. but when we run this code, we don't see the circle. what are we missing?

you need to add the circle with the add(circle) command

3
New cards

which of the following will accomplish the given the following function (assume SIZE, HEIGHT, and WIDTH are properly defined)

x= random.randint(SIZE, WIDTH-SIZE)

Y= random.randint(SIZE, WEIGHT-SIZE)

draw_circle(x,y, SIZE)

4
New cards

Why do we write functions?

I, II, and III

5
New cards

in the following function print_three_times what is the parameter of the function

word

6
New cards

what is the output of the following program

15 5

7
New cards

what is printed by the following program

0

1

2

8
New cards

how many parameters go into the function and how many return values come out of the function

3 go in, 1 return value comes out

9
New cards

which of the following functions is the correct implementation of is_superman?

def is_superman(is_bird, is_plane):

return not is_bird and not is_plane

10
New cards

what is printed by the following program

7

11
New cards

which variables could you type at point a and the program will still work

result, x, y, num1, num2, and MAX_NUMBER (longest choice)

12
New cards

functions must have parameters

false

13
New cards

which statement allows us to return values from functions

return

14
New cards

which of the following is true for a API?

I, II, III, IV, V, and VI (longest choice)

15
New cards

what does API stand for in computer science

Application Programming Interface

16
New cards

what is the purpose of a return statement in a function

stops executing the function and returns the value

17
New cards

which of the following is true about return values

Functions can have return values, but they are optional.

18
New cards

consider the following code snippet. what is returned and printed for the value of a?

10

19
New cards

what does the mystery function do in the code snippet below

returns the smaller of two values passed to it

20
New cards

consider the following code snippet. what would the following print

this would generate an error

21
New cards

which of the following functions will correctly return true if it is passed an odd integer value for x?

I and III only

22
New cards

in the third call to draw_circle(), what values are passed to the coordinates of the center of the circle

150, 150

23
New cards

what is the return value for this function

this function has no return value

24
New cards

what are the names of the parameters

first, second, third

25
New cards

which of the following is the correct way to create a function in python?

def my_function():