`Create a Python procedural function(procedure) named square_odd_numbers that takes a list of numbers as its argument. The procedure should print a new list containing the squares of only the odd numbers from the input list.
use a while loop in the answer.
Example:
Input: [1, 2, 3, 4, 5]
Output (printed to the console): [1, 9, 25]
Call the procedure using the above data as input.
For example: Test >>>>>>>>>>> Result
#only your code >>>>>> [1, 9, 25]
test_list = [111, 62, 35, 47, 5]>>>>>>>>[12321, 1225, 2209, 25] square_odd_numbers(test_list)
def square_odd_numbers():
a = [1, 2, 3, 4, 5]
i = 1
while i <= 6:
if i%2 != 0:
print(i ** 2)
i += 1
square_odd_numbers()
Test program is not accepting what I did. Can someone explain to me? It is python programming.`
... that takes a list of numbers as its argument, your function does not take anything as an argument. I'd start with that. Also it doesn't print a list, but rather separate values.