Write a function that takes two strings, and
- if they are equal, it returns "They are equal"
- if they are not equal, it returns "They are not equal"
What is the main difference between a list and a tuple in Python?
|  Lists are immutable, tuples are mutable | ||
|  Tuples are immutable, lists are mutable | ||
|  Tuples can hold elements of only the same type |
Write a function that takes a dictionary and returns its length
s = {1, 2, 3}
s.add(1)
s.add(4)
s.update([3, 4, 5])
What is the value of s at the end of execution of the above script?
What does the * operator do a tuple and an integer?
|  It multiplies each element inside the tuple by the integer | ||
|  It adds the integer to each element of the tuple | ||
|  It repeats the entire tuple that many times | ||
|  It creates a set with repeated elements |
Write a function which takes a tuple and returns its element before the last.
def slices(word, x, y):
return word[x:y]
Given the above script, what are the results of the following expressions:
| slices("Butch...", 0, 5): | ||
| slices("Butch...", 4, 6): | ||
| slices("Butch...", -4, -1): |
d = {'a': 1, 'b': 2}
for k in d:
print(d[k])
Given the above script, what are the two printed values?
Complete execution flow of the following program
>>>
Complete execution flow of the following program
fruit = "kiwi" for letter in fruit: print(letter)