Created
January 3, 2019 21:33
-
-
Save ryanorsinger/e0c23e9f451449827847135d495dc2cd to your computer and use it in GitHub Desktop.
Flashcards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Flashcard Drills | |
4 in [1, 2, 3, 4] | |
list(range(1, 7)) | |
[x for x in range(1, 5)] | |
[x*3 for x in range(1, 5)] | |
sum(range(1, 4)) | |
# Given the following array, write the code that gets the first two elements in their own list. | |
fruits = ["mango", "kiwi", "apple", "guava"] | |
"a" in "banana" | |
"z" not in "banana" | |
"a" in list("banana") | |
list("banana") | |
tuple("banana") | |
total = 0 | |
total += 2 | |
total += 6 | |
# what is total? | |
10 % 5 | |
10 % 3 | |
10 % 2 | |
10 % 7 | |
letters = ["a", "b", "c", "d", "e", "f"] | |
# what does letters[:3] return? | |
letters = ["a", "b", "c", "d", "e", "f"] | |
# what does letters[2:] return? | |
letters = ["a", "b", "c", "d", "e", "f"] | |
# what does letters[2:4] return? | |
"zipline"[-1:] | |
"zipline"[-2:] | |
"zipline"[-3:] | |
"zipline"[:-1] | |
"zipline"[:-2] | |
"zipline"[1:3] | |
letters = ["a", "b", "c", "d", "e", "f"] | |
# what does letters[-1:] return? | |
letters = ["a", "b", "c", "d", "e", "f"] | |
# what does letters[:-2] return? | |
letters = ["a", "b", "c", "d", "e", "f"] | |
# what does letters[-2:] return? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment