-2

how should I define a function that takes in a string and returns the string in upper and lowercases according to even and odd indexing?

def myfunc(string):
    for some in string:
        if string.index%2==0:

I have written this much but I do not know what should I type now.

please help.

Meloman
  • 3,558
  • 3
  • 41
  • 51
Aditya
  • 1
  • 2

1 Answers1

0

Here you can find the string methods Specially look at upper() and lower() which will be your friend here.

Teekeks
  • 196
  • 10