APCOMPSCI EXAM QUIZLET

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
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 a function?

a block of code which only runs when it is called. You can pass data, known as parameters, into a function. A function returns a value and a procedure just executes commands.

2
New cards

what is a procedure?

allows us to group a block of code under a name, known as a procedure name. We can call the block of code from anywhere in the program to execute

3
New cards

on the AP exam are procedure and function different?

no, procedure == function

4
New cards

what are parameters in a function?

The parameters to a function are the inputs to the function (what is being passed into the function).

5
New cards

what are arguments in a function?

_______ are the inputs to a function.

6
New cards

what are the 4 data types?

string, integer, float, boolean

7
New cards

what is try/except used for?

to try something except (ValueError)

8
New cards

what is the difference between print and return?

return - return a value to where you called it from. This can be useful for returning a value somewhere.

print - print just simply prints something, it doesn't return any values to the calling function.

9
New cards

what is local scope?

one that can only be seen, used and updated by code within the same scope. Typically this means the variable was declared (created) inside a function -- includes function parameter variables

10
New cards

what is a local variable?

A variable that is declared in the body of a method.

11
New cards

what is a global variable?

any variable defined outside all the functions in a program

12
New cards

what does floor division do?

This operator will divide the first argument by the second and round the result down to the nearest whole number

13
New cards

what does real division do?

has all of the decimals, the real number

14
New cards

what does modulus do?

gives the remainder

15
New cards

is random inclusive or exclusive?

inclusive

16
New cards

is for i in range inclusive or exclusive?

exclusive

17
New cards

what is scope?

A variable is only available from inside the region it is created.

18
New cards

what is the difference between = and ==?

The = is a simple assignment operator. It assigns values from right side operands to the left side operand. While on the other hand == checks if the values of two operands are equal or not.

19
New cards

what is a SENTINEL?

A sentinel is a special value that marks the end of a sequence of values.

20
New cards

what is the difference between display and print in python?

display - everything on same row

print - different rows

21
New cards

how do you stop a While True loop?

break

22
New cards

what does true AND false equal?

false

23
New cards

what does true OR false equal?

true

24
New cards

what is the hexadecimal number system?

1 2 3 4 5 6 7 8 9 A(10) B(11) C(12) D(13) E(14) F(15)

25
New cards

what is the difference between print and input?

Using the input() function, we take input from a user, and using the print() function, we display output on the screen