1/14
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
nums[i]
Accesses the element at index i
nums[-1]
Accesses the last element
nums[a:b]
Gets elements from index a to b - 1
nums[::-1]
Returns nums reversed
nums.append(x)
Adds x to the end of nums
nums.pop()
Removes and returns the last element
nums.sort()
Sorts nums in place ascending
sorted(nums)
Returns a new sorted list
[x for x in nums if x > 0]
Creates a list of positive values
s[i]
Accesses character at index i
s[a:b]
Gets substring from index a to b - 1
s.split()
Splits string by whitespace
"".join(chars)
Joins characters into one string
ord(c) - ord("a")
Maps some lower case letter c to index 0 through 25 by taking advantage of ascii values of lowercase letters
[[0] * cols for _ in range(rows)]
Creates a 2D grid with independent rows