Define a function, more_than_n(word, n), that returns True if word has more than n letters.
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?
Define a function that takes a list and adds 'pse' to the end of it.
Write a function that takes no arguments and returns a dictionary with 6 elements, where keys are floats and values are integers.
Write a function that takes one string and two integers, line, n and m,
and returns its characters from index n to index m (including n but not m). Example:
>>> chars('slices', 1, 3)
'li'
>>> chars('indices', 2, 5)
'dic'
Define a function that takes one list and a value, t and v, and changes its last element to v.
def return_char(s, n):
return s[n]
Given the above script, what are the results of the following expressions:
| return_char('llukar', 0): | ||
| return_char('xerxe', 3): | ||
| return_char('carralluke', 1): |
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): |
Complete execution flow of the following program
def are_equal(s1, s2): return s1 == s2
Complete execution flow of the following program
print("Ani".isupper()) a = "ANI" res = a.isupper() print(res)