Question: Define a function called myfunc that takes in a string, and returns a matching string where every even letter is uppercase, and every odd letter
myfuncC'Anthropomorphi sm) #Output: 'aNtHrOpOm0rPhIsM | Added note: this exercise requires that the function return a string. Print statements will not work here. A Oops, your solution is incorrect 1- def myfunc(string): 2 lst = [] 3 for i in range (0,len(string)): exercise.py False is not true: This is incorrect if ix2-0: 1 lst.appendCstringi]) else: Lst.append(string[i].upper a -join(lst) return(a)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
