Terms Flashcards

(39 cards)

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
{0} is used as what?
a placeholder
26
What command is used to search code for a variable and output the value assigned?
.format()
27
When using return you must do what for it to output?
use print() then call the function for it to output print(functionName())
28
If then statements are used in the format?
if: elif: else:
29
The elif command allows you to what?
chain together if statements to make one conclusion
30
When incorporation integers into if then statements what can you use?
>, <, <=, >=, and ==
31
When coding where does counting start?
at 0
32
lists are noted with what?
[]
33
when discussing lists, n is used to denote what?
the total number of items on the lists
34
index is used for what?
to denote a position on a list
35
what command finds the total number of items on a list?
len(listName)
36
When retrieving items from a list, what is the computer doing?
finding what item is in a certain position on the list
37
Loops are used for what?
to repeat a sequence of instructions until a condition is met
38
What is the format to begin a loop?
for index in range ( , ): logic goes here
39
the end value on a loop range is?
non-inclusive