Given two integers, find the absolute difference between their sum and the sum of their squares.
Eg.
a, b = 2,3
sum is 5
sum of squares is 13
absolute difference is 8
Args:
a - int : The first integer.
b - int : The second integer.
Returns:
int: absolute difference between the sum and the sum of squares
Implement this function:
def abs_diff_between_sum_and_sum_of_squares(a:int, b: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: a, b.
Input
2
3
Output
8
Given two integers, find the absolute difference between their sum and the sum of their squares. Eg.\ a, b = 2,3\ sum is 5\ sum of squares is 13\ absolute difference is 8 Args: ``` a - int : The first integer. b - int : The second integer. ``` Returns:\ int: absolute difference between the sum and the sum of squares ## Your task Implement this function: ```python def abs_diff_between_sum_and_sum_of_squares(a:int, b: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: `a`, `b`. ## Example **Input** ``` 2 3 ``` **Output** ``` 8 ``` Given an odd-length string, swap the parts before and after the middle three characters, while keeping the middle three characters in place. Assume the string has at least 5 characters. ### Examples ``` "firstabclast1" -> "last1abcfirst" "abcdefghi" -> "ghidefabc" ``` Args:\ s (str): The input string of odd length. Returns:\ str: The modified string with the parts swapped. ## Your task Implement this function: ```python def swap_except_middle_three(s: str) -> str: ``` 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: `s`. ## Example **Input** ``` 'abcdefghi' ``` **Output** ``` 'ghidefabc' ``` Given three lists of same length, interleave them together and return the interleaved list. ### Example ``` list1 = [1, 2, 3] list2 = ['a', 'b', 'c'] list3 = [(1,1),(2,2),(3,3)] output = [1, 'a', (1,1), 2, 'b', (2,2), 3, 'c', (3,3)] ``` Args: ``` list1 (list): The first list. list2 (list): The second list. list3 (list): The third list. ``` Returns:\ list: A list containing interleaved elements from all three lists. ## Your task Implement this function: ```python def interleave_lists(list1, list2, list3): ``` 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: `list1`, `list2`, `list3`. ## Example **Input** ``` [1, 2, 3] ['a', 'b', 'c'] [(1, 1), (2, 2), (3, 3)] ``` **Output** ``` [1, 'a', (1, 1), 2, 'b', (2, 2), 3, 'c', (3, 3)] ```