Coding notes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:31 AM on 6/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

6 Terms

1
New cards

Length check

len(itemoflength)

2
New cards

Range

Uses () not [], normal brackets are for functions like range and square brackets are for indexing

First argument is inclusive. Second argument is not. E.g. for i in range(0,7) will stop and not run if i is 7.

A third argument is the steps. This means you don’t have to increment i yourself. You can choose the direction and amount you want to increment, e.g. 3 or -1.

If you dont include a step, i will still increment by 1 always.

3
New cards

While loops don’t use in range

For loops automatically increment i because the range function has a step parameter even if you don’t sub it in.

No in range means you have to set i as 0 and increment it yourself

4
New cards

Select section of an array

arr[:3]

arr[2:]

First parameter inclusive, second is not

5
New cards

Making an empty 2D array

arr = [[0]*cols]*rows

where cols and rows are integers

6
New cards

Insertion sort

Cannot move all items along and then insert. Must shuffle it down one by one