Write a function that takes no arguments and returns a dictionary with 4 elements.
Write a function which takes a tuple and returns its last element.
Create a function which takes no arguments and returns a tuple with 4 elements.
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"
Define a function that takes a string and an integer, word and n, and returns character of word with index n + 1.
Write a function, to_upper which takes a string as argument and returns the uppercase version of the string.
Define a function that takes one list as argument and returns its third to last element (the third element from the end).
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): |
Complete execution flow of the following program
print("Ani".isupper()) a = "ANI" res = a.isupper() print(res)
Complete execution flow of the following program
>>>