Write a function which takes a tuple and returns its first element.
Write a function that takes no arguments and returns a dictionary with 2 elements.
Write a function that takes one string, and returns True if "a" appears in the string. It returns False otherwise.
What happens when you try to change an element of a tuple?
|  The tuple updates successfully | ||
|  You get a TypeError | ||
|  It changes the last element instead | ||
|  The program automatically converts it to a list |
Write a function which takes a tuple, t and returns a new tuple which is the repetition of t 4 times.
Write a function which takes a set, s, and another argument, a, and it deletes
a from s if a is in s. Otherwise it does nothing.
Function should return None.
def is_char(word, ch, i):
return word[i] == ch
Given the above script, what are the results of the following expressions:
| is_char("llukar", "u", 3): | ||
| is_char("xerxe", "x", 0): | ||
| is_char("carralluke", "c", 1): |
words = {"the": 301, "why": 200, "ok": 3}
Given the above script?
| What is the the value of words: | ||
| What is type of words: | ||
| How many elements does words have: | ||
| What is the value mapped to "why": | ||
| What is the key the value 3 is mapped to: |
Complete execution flow of the following program
def in_both(word1, word2): for letter in word1: if letter in word2: print(letter)
Complete execution flow of the following program
fruit = "kiwi" for letter in fruit: print(letter)