+ 8
[ASSIGNMENT] - Alternating and Reversing w/ Strings
input: hello world output1: HeLlO WoRlD output2: DlRoW OlLeH output3: OlLeH DlRoW You get it :) Challenge is launched Take your weapons! Any language is welcome! https://code.sololearn.com/cV2YYOCH3K7K/?ref=app https://code.sololearn.com/cKOEA9PiBMcO/?ref=app edit: now, this one too https://code.sololearn.com/cF14IqYlgQ2l/?ref=app
11 Answers
+ 15
#python.
a=input();b='';c=1
for i in a:
if c==1:
b+=i.upper()
c=0
else:
b+=i.lower()
c=1
print(b)
print(b[::-1])
print(*b[::-1].split()[::-1])
+ 13
Here's mine :
https://code.sololearn.com/cg43K8rGX0eW/?ref=app
+ 11
https://code.sololearn.com/cpHIo5q42b09/?ref=app
+ 5
https://code.sololearn.com/crnkoH4O5Ayr/?ref=app
+ 5
#One line
[print(i, '\n', i[::-1], '\n', *map(lambda j: j[::-1], i.split())) for i in [input()]]
+ 5
Edit::
[print(i, '\n', i[::-1], '\n', *map(lambda j: j[::-1], i.split())) for i in [''.join(map(lambda x: x[1].lower() if x[0]%2!=0 else x[1].upper(), enumerate(input())))]]
+ 4
+ 3
Here's my third attempt, now in C.
This one took me a life to put it on the right corners
https://code.sololearn.com/cF14IqYlgQ2l/?ref=app
+ 1
Here's my attempt in C:
https://code.sololearn.com/c8cAK9UxBxCy/#c
+ 1
https://code.sololearn.com/c3CT9Z8hmjfa/?ref=app
here we go