Review Flashcards

1
Q

math operators

A
Exponentiation (**)
Multiplication (*)
division (/ and //)
remainder (%)
Addition (+) and subtraction (-)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

and

A

false and false = false
false and true = false
true and false = false
true and true = true

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

or

A

false and false = false
false and true = true
true and false = true
true and true = true

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

end

A

end=’delimiter’ causes print to place delimiter (space) at end of data instead of newline character

space at the end, new line

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

sep

A

sep=’delimiter’ causes print to use delimiter (space) as item separator

apace in the middle

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

input function

A

Built-in input function reads input from keyboard
•Returns the data as a string
•Format: variable = input(prompt)
•prompt is typically a string instructing user to enter a value

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

Boolean is always T or F?

A

T

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

usage of if/else

A

multiple conditions are being used

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

usage of loop

A

reduce number of code

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

inner loop

A

always indented, always get executed to the outer loop

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

range functions

A

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

convert to float

a=123.99

A

trick question, its already a float

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

and/or/not

A

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

iteration

ex: (#,#,#)

A

first number is where you start
second number is where you end (dont include)
third number is what you count by

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

example:

for num in range (4)

A

0,1,2,3

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

example:
for num in range (1,9,2)
iteration(4)

A

1,3,5,7

17
Q

example:

for num in range (0,20,5)

A

0,5,10,15