Coding tests Flashcards

1
Q

how to see if you’re on last item of an array in python?

A

for k, v in enumerate(inputArray):

    if k != len(inputArray) - 1:
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how to loop through keys and values in an array (python)?

A

use enumerate, for k, v in enumerate(inputArray):

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

how to reverse a python string?

A

“abcdefghijk”[::-1]

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

what are the high level steps?

A

read, ask Q’s, deeply understand, write steps, confirm, setup code IO, code, debug

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