Computer Science, asked by choudharyparvesh2001, 5 months ago

. Write a code snippet that can arrange the alphabets of a name entered by user in alternate
cases. Note: Ignore white spaces.

Answers

Answered by jai696
2

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def case_convert(name):

chars = list(name)

for i in range(len(chars)):

if chars[i].isspace():

pass

elif i % 2 == 0:

chars[i] = chars[i].upper()

else:

chars[i] = chars[i].lower()

return "".join(chars)

print(case_convert((n := input("name: "))))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions