Skip to content

Instantly share code, notes, and snippets.

@accessnash
Created May 18, 2018 19:09
Show Gist options
  • Select an option

  • Save accessnash/0f688e2f5f3f90cbeee8675c66c1fde3 to your computer and use it in GitHub Desktop.

Select an option

Save accessnash/0f688e2f5f3f90cbeee8675c66c1fde3 to your computer and use it in GitHub Desktop.
Every even letter in a string is upper case and odd letter is lower case
def myfunc(string):
str = ''
index =0
for l in string:
if index %2 ==0:
str = str + l.lower()
index +=1
else:
str = str + l.upper()
index +=1
return str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment