Write a function describe_number that takes an integer as input and returns:
"Fizz" if the number is divisible by 3.
"Buzz" if divisible by 5.
"FizzBuzz" if divisible by both 3 and 5.
"Normal" if it is divisible by neither.
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.
describe_number(9) -> "Fizz"
describe_number(10) -> "Buzz"
describe_number(15) -> "FizzBuzz"
describe_number(7) -> "Normal"
Implement this function:
def describe_number(num: int) -> 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: num.
Input
9
Output
'Fizz'
Write a function describe_number that takes an integer as input and returns: ``` "Fizz" if the number is divisible by 3. "Buzz" if divisible by 5. "FizzBuzz" if divisible by both 3 and 5. "Normal" if it is divisible by neither. ``` 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 ``` describe_number(9) -> "Fizz" describe_number(10) -> "Buzz" describe_number(15) -> "FizzBuzz" describe_number(7) -> "Normal" ``` ## Your task Implement this function: ```python def describe_number(num: int) -> 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: `num`. ## Example **Input** ``` 9 ``` **Output** ``` 'Fizz' ``` Write a function card_to_value_tuple that takes in a playing card of as a string of format '{rank}{suit}' and returns a tuple of integers format (suit_value, rank_value) as described below. The suit values from low to high: S (Spades) - 1\ H (Hearts) - 2\ D (Diamonds) - 3\ C (Clubs) - 4 The rank values from low to high: A (Ace) - 1\ 2 through 10 - same as the number\ J (Jack) - 11\ Q (Queen) - 12\ K (King) - 13 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 ``` >>> card_to_value_tuple('AH') (2, 1) >>> card_to_value_tuple('7D') (3, 7) >>> card_to_value_tuple('QS') (1, 12) >>> card_to_value_tuple('9C') (4, 9) >>> card_to_value_tuple('10D') (3, 10) ``` ## Your task Implement this function: ```python # This mappings can be used as needed. ``` 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: `card`. ## Example **Input** ``` 'AH' ``` **Output** ``` (2, 1) ``` Write a function rotate_even(l, k), which rotates the elements at the even indices by k positions. Hint: This can be solved using slicing and slice update. 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\ ``` >>> rotate_even([1,2,3,4,5,6],1) [5,2,1,4,3,6] >>> rotate_even([1,2,3,4,5,6,7,8],3) [3,2,5,4,7,6,1,8] ``` ### Explanation ``` rotate_even([1,2,3,4,5,6],1) ``` ``` +----------+ | +---+ | | | V | | [1,2,3,4,5,6] | ^ | ^ +--+ +---+ ``` Each element moves 1 even index and cycle back. 1 (index 0) moves to index 2\ 3 (index 2) moves to index 4\ 5 (index 4) moves to index 0 ``` rotate_even([1,2,3,4,5,6,7,8],3) ``` ``` +-----------+ | +---+ | | V | V [1,2,3,4,5,6,7,8] ^ | ^ | +---+ +---+ ``` Each element moves two even indices and cycle back. 1 (index 0) moves to index 6\ 3 (index 2) moves to index 0\ 5 (index 4) moves to index 2\ 7 (index 6) moves to index 4 ## Your task Implement this function: ```python def rotate_even(l: list, k: int) -> list: ``` 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: `l`, `k`. ## Example **Input** ``` [1, 2, 3, 4, 5, 6] 1 ``` **Output** ``` [5, 2, 1, 4, 3, 6] ```