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 both). Example:
>>> chars('slices', 1, 3)
'lic'
>>> chars('indices', 2, 5)
'dice'
Define a function that takes a string and a character, word and char, and returns True if fourth character of word is equal to char.
Write a function that takes one string, and returns True if "a" appears in the string. It returns False otherwise.
Define a function, all_vowels_in(word), that returns True if the word contains all 5 vowels (a, e, i, o, u), False otherwise.
Write a function that takes one string and returns True if it is greater (comes after) than "Pse". It returns False otherwise.
Define a function count_shared_letters(word1, word2) that returns the number of letters from word1 that are found in word2.
def return_char(s, n):
return s[n]
Given the above script, what are the results of the following expressions:
| return_char('zanatek', -1): | ||
| return_char('zanatek', -4): |
def pse(a, b):
return a[3] < b[2]
Given the above script, what are the results of the following expressions:
| pse('Pobre', 'Johejdi'): | ||
| pse('psespodon', 'sdumore'): |
Complete execution flow of the following program
>>>
Complete execution flow of the following program
def are_equal(s1, s2): return s1 == s2