Write a function, is_book_available, that takes a book title and a list of available books,
book and books, and returns True if the book is in the list of books,
otherwise False. Example:
>>> is_book_available("1984", ["1984", "The Hobbit"])
True
>>> is_book_available("Of Mice And Men", ["1984", "The Hobbit"])
False
Define a function that takes a list and adds 32 to the end of it.
Write a function that takes two strings, s1, and s2, and returns True if s1 appears in s2 as substring.
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 an integer, word and n, and returns character of word with index n + 1.
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 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 return_char(s, n):
index = len(s) - n
return s[index]
Given the above script, what are the results of the following expressions:
| return_char("zanatek", 2): | ||
| return_char("zanatek", 3): |
Complete execution flow of the following program
>>>
Complete execution flow of the following program
sentence = "I live here" print(sentence[2:6])