Write a function are_orthogonal that takes two tuples t1 and t2 as input. Each tuple represents a 2D vector with two elements (x, y). The function should return True if the vectors are orthogonal (perpendicular), and False otherwise.
Hint: Two vectors are orthogonal if their dot product is zero. Dot product is the sum of product of the corresponding elements in the vectors.
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.
>>> are_orthogonal((1, 2), (12, -6)) # 1*12 + 2*(-6) = 0, equal to zero
True
>>> are_orthogonal((2, 0), (4, 1)) # 2*4 - 1*0 = 8, not equal to zero
False
>>> are_orthogonal((0, 5), (-5, 0)) # 0*(-5) - 5*0 = 0, equal to zero
True
Implement this function:
def are_orthogonal(t1: tuple, t2: tuple) -> 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: t1, t2.
Input
(1, 2)
(12, -6)
Output
True
Write a function are_orthogonal that takes two tuples t1 and t2 as input. Each tuple represents a 2D vector with two elements (x, y). The function should return True if the vectors are orthogonal (perpendicular), and False otherwise. Hint: Two vectors are orthogonal if their dot product is zero. Dot product is the sum of product of the corresponding elements in the vectors. 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. ### Examples ``` >>> are_orthogonal((1, 2), (12, -6)) # 1*12 + 2*(-6) = 0, equal to zero True >>> are_orthogonal((2, 0), (4, 1)) # 2*4 - 1*0 = 8, not equal to zero False >>> are_orthogonal((0, 5), (-5, 0)) # 0*(-5) - 5*0 = 0, equal to zero True ``` ## Your task Implement this function: ```python def are_orthogonal(t1: tuple, t2: tuple) -> 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: `t1`, `t2`. ## Example **Input** ``` (1, 2) (12, -6) ``` **Output** ``` True ``` Write a function next_roll_no that takes a roll number roll_no as input and returns the next roll number in sequence within the same year and term. The roll number format is {yy}f{t}{num}, where: {yy} represents the two-digit year\ f is a fixed character ``` {t} represents the term number (1, 2, or 3) {num} is a six-digit number padded with zeros on the left ``` Assume the num part of the roll number will be less than 999999. ### Example ``` next_roll_no("23f2000001") -> '23f2000002' next_roll_no("24f3099999") -> '24f3100000' ``` 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. ## Your task Implement this function: ```python def next_roll_no(roll_no: 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: `roll_no`. ## Example **Input** ``` "23f2000001" ``` **Output** ``` '23f2000002' ``` Write a function has_no_vowels_in_even_indices that takes a string s as input and returns True if there are no vowels in the even indices of the string, otherwise returns False. 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. ### Examples ``` >>> has_no_vowels_in_even_indices("babebibobu") # The vowels are present in odd indices True >>> has_no_vowels_in_even_indices("abcde") # a is present in even index 0 False >>> has_no_vowels_in_even_indices("test") # only vowel e is present in odd index 1 True >>> has_no_vowels_in_even_indices("why") # no vowels True ``` ## Your task Implement this function: ```python def has_no_vowels_in_even_indices(s: 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: `s`. ## Example **Input** ``` "babebibobu" ``` **Output** ``` True ```