Write a function which takes a tuple and returns its last element.
Write a function which takes a tuple and one integer, t and i, and returns element of t with index i.
Define a function that takes a string and returns True if its first character is 'b'.
def to_set(v):
return set(v)
s1 = {1, 2, 3, 3, 3}
s2 = to_set('aan')
Given the above script, what are the values of the following variables?
| s1: | ||
| s2: |
s = {'ani', 2}
s.update(s)
s.update({"ani", 2})
s.add(3)
What is the value of s at the end of execution of the above script?
Write a function that takes two strings, s1, and s2, and returns True if s1 is smaller than (comes before) s2.
def return_char(s, n):
return s[n]
Given the above script, what are the results of the following expressions:
| return_char('powl', -1): | ||
| return_char('powl', -3): |
population = {"Babrruja": 300, "Llukar": 100, "Carralluke": 50}
population["babrruja"] = 301
population["Llukar"] = 250
Given the above script?
| What is the final value of population: | ||
| What is the final number of elements of population: | ||
| What is the final value of "Babrruja": |
Complete execution flow of the following program
>>>
Complete execution flow of the following program
fruit = "kiwi" for letter in fruit: print(letter)