Created
May 18, 2018 19:09
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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