Coding Quiz - String Case Conversion
In this coding quiz, you'll write a function that converts characters in a given string to uppercase at even indices and to lowercase at odd indices.
For example, if the input string is codefriends
, the output should be cOdEfRiEnDs
.
Write Your Code
def solution(s): # Write your code here return
Constraints
-
The length of the input string is between 1 and 100.
-
The string contains only alphabetic letters.
Example Input/Output
-
Input:
codefriends
-
Output:
cOdEfRiEnDs
-
Input:
CoDe
-
Output:
cOdE
Lecture
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help