Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
12 Cards in this Set
- Front
- Back
Define Dictionary |
dict = {'Name': 'Paul', 'Age': '48', 'Class': 'Prime'} |
|
Print the first element of the dictionary |
print "dict['Name']: ", dict['Name'] |
|
Define a tuple |
tup2 = (1, 2, 3, 4, 5 ); |
|
Define a string tuple |
tup3 = "a", "b", "c", "d"; |
|
Concatenate two tuples |
tup3 = tup1 + tup2; |
|
Iterate a tuple |
for x in (1, 2, 3): print x, |
|
Test for membership in a tuple |
3 in (1, 2, 3) yields true |
|
Define an integer list |
list2 = [1, 2, 3, 4, 5, 6, 7 ]; |
|
Change the third element of a list |
list[2] = 2001; |
|
Delete an element of a list |
del list1[2]; |
|
Insert an item in a list |
list.insert(index, obj)Inserts object obj into list at offset index |
|
Append an item to a list |
list.append(obj)Appends object obj to list |