Terms Flashcards

1
Q

What command will output what is in parenthesis?

A

print()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What command will output what is in parenthesis as an integer?

A

int()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the term for any decimal number?

A

float

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What command will output what is in parenthesis as a float?

A

float()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the term for text?

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What command will output what is in parenthesis as a string?

A

str()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the mathematical symbol for division?

A

/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the mathematical symbol for the remainder?

A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the mathematical symbol for exponents?

A

**

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a comment?

A

any code that is ignored and does not affect the output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What symbol is placed in front of code that makes it a comment?

A

#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a term that is created and defined?

A

variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a function?

A

A function is a section of code that is defined and can be called for later use under one command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you format the start of a function?

A

def functionName():

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Everything in a function must be what?

A

indented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is another way to say the instructions or set of commands for your function?

A

the function logic

17
Q

How do you output a function?

A

Call it with the format functionName()

18
Q

What are function parameters?

A

values or variables that are placed in the parenthesis of the function and must be defined before calling them

19
Q

Where are function parameters placed?

A

def functionName(here):

20
Q

When placing values to the function parameters, where are the values placed?

A

functionName(here)

21
Q

returning a function is what?

A

getting a value back

22
Q

you can update a variable in the same code because?

A

code is read from top to bottom

23
Q

Why are functions useful?

A

you can use it over and over without having to copy and paste large sections of code

24
Q

The order of the function parameters match what?

A

the order of the value

25
Q

{0} is used as what?

A

a placeholder

26
Q

What command is used to search code for a variable and output the value assigned?

A

.format()

27
Q

When using return you must do what for it to output?

A

use print() then call the function for it to output
print(functionName())

28
Q

If then statements are used in the format?

A

if:
elif:
else:

29
Q

The elif command allows you to what?

A

chain together if statements to make one conclusion

30
Q

When incorporation integers into if then statements what can you use?

A

> , <, <=, >=, and ==

31
Q

When coding where does counting start?

A

at 0

32
Q

lists are noted with what?

A

[]

33
Q

when discussing lists, n is used to denote what?

A

the total number of items on the lists

34
Q

index is used for what?

A

to denote a position on a list

35
Q

what command finds the total number of items on a list?

A

len(listName)

36
Q

When retrieving items from a list, what is the computer doing?

A

finding what item is in a certain position on the list

37
Q

Loops are used for what?

A

to repeat a sequence of instructions until a condition is met

38
Q

What is the format to begin a loop?

A

for index in range ( , ):
logic goes here

39
Q

the end value on a loop range is?

A

non-inclusive