Question: use python IDLE when providing your solution and answer everything above 1. Compose a function called print_lst_even that accepts a single list of integers as
use python IDLE when providing your solution and answer everything above
1. Compose a function called print_lst_even that accepts a single list of integers as an argument. It should print all even elements within the list, each on its own line, in the same order in which they appear within the list. For example, print_lst_even ([1,4, 6, 7, 8, 9, 10]) \# output (via print) #4 #6 #8 #10 2. Compose a function called print_lst_odd that accepts a single list of integers as an argument. It should print all odd elements within the list, each on its own line, in the same order in which they appear within the list. For example, print_lst_odd ([1,4,6,7,8,9,10]) \# output (via print) \# 1 \# 7 \# 9 3. Compose a function called lst_odd_even that accepts a single list of integers as an argument. It should return a new list, containing the square of each even element within the input list, and the cube of each odd element, in the same order in which the elements appear in the input list. The input list should remain unchanged following the function call. For example, \[ \text { lst_odd_even }([1,4,6,7,8,9,10]) \text { \# output: }[1,16,36,343,64,729,100] \] 4. Compose a function called str_ len that accepts a single list of strings as an argument. It should return the string from the input list having the longest length, or an empty string ("") if the list is empty. hint: you can use the len () function on strings to get their length. For example, str_len(["hello", "world", "abc", "123", "other stuff"]) \# output: "other stuff" str_len([]) \# output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
