Write a function is_both_divisible_by that takes three integers a, b and c as input and checks if a and b numbers are divisible by c. Assume that c number is non-zero.
NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition.
>>>is_both_divisible_by(10, 15, 5) # both 10 and 15 are divisible by 5
True
>>>is_both_divisible_by(10, 13, 5) # 13 is not divisible by 5
False
>>>is_both_divisible_by(19, 15, 5) # 19 is not divisible by 5
False
Implement this function:
def is_both_divisible_by(a: int, b: int, c: int) -> bool:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: a, b, c.
Input
10
15
5
Output
True
Write a function is_both_divisible_by that takes three integers a, b and c as input and checks if a and b numbers are divisible by c. Assume that c number is non-zero. NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition. ### Example ``` >>>is_both_divisible_by(10, 15, 5) # both 10 and 15 are divisible by 5 True >>>is_both_divisible_by(10, 13, 5) # 13 is not divisible by 5 False >>>is_both_divisible_by(19, 15, 5) # 19 is not divisible by 5 False ``` ## Your task Implement this function: ```python def is_both_divisible_by(a: int, b: int, c: int) -> bool: ``` Write the function only — the arguments are read for you and the return value is printed automatically. **Arguments** arrive as one Python literal per line, in this order: `a`, `b`, `c`. ## Example **Input** ``` 10 15 5 ``` **Output** ``` True ``` Write a function that checks if one string is a rotation of another. Hint: all the rotations of a particular string will be present in the string formed by concatenating it with itself. For example the rotations of the word apple can be formed by. a[pplea]pple - pplea\ ap[pleap]ple - pleap\ app[leapp]le - leapp\ appl[eappl]e - eappl\ apple[apple] - apple NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition. ### Example ``` >>>is_rotation('abcde','cdeab') True >>>is_rotation('hello','ehllo') False >>>is_rotation('hello','helol') False ``` ### Explanation Since cdeab is a rotation of abcde, So, is_rotation('abcde','cdeab') should return True ## Your task Implement this function: ```python def is_rotation(str1: str, str2: str) -> bool: ``` Write the function only — the arguments are read for you and the return value is printed automatically. **Arguments** arrive as one Python literal per line, in this order: `str1`, `str2`. ## Example **Input** ``` 'abcde' 'cdeab' ``` **Output** ``` True ``` Given a list with numbers from 1 to n (inclusive) except one number in the range, write a function to find the missing number. Assume that only one number from the range will be missing in the given list. NOTE: This is a function type question, you don't have to take input or print the output, just have to complete the required function definition. ### Example Given the inputs nums=[1, 4, 2, 4, 6, 5, 6] and n is 6. The number 3 is missing from the range. So, find_missing_number(nums) should return 3 as it is the missing number. ## Your task Implement this function: ```python def find_missing_number(nums: list, n: int) -> int: ``` Write the function only — the arguments are read for you and the return value is printed automatically. **Arguments** arrive as one Python literal per line, in this order: `nums`, `n`. ## Example **Input** ``` [1, 4, 2, 4, 6, 5, 6] 6 ``` **Output** ``` 3 ```