+ 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

11th Dec 2017, 2:21 PM
Jonathan Álex
Jonathan Álex - avatar
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])
11th Dec 2017, 4:58 PM
KäzÎ MrÎdÚl HøssäÎn
KäzÎ MrÎdÚl HøssäÎn - avatar
11th Dec 2017, 7:05 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 11
https://code.sololearn.com/cpHIo5q42b09/?ref=app
11th Dec 2017, 9:39 PM
LukArToDo
LukArToDo - avatar
11th Dec 2017, 7:04 PM
David Ashton
David Ashton - avatar
+ 5
https://code.sololearn.com/crnkoH4O5Ayr/?ref=app
11th Dec 2017, 3:25 PM
...
+ 5
#One line [print(i, '\n', i[::-1], '\n', *map(lambda j: j[::-1], i.split())) for i in [input()]]
12th Dec 2017, 2:30 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 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())))]]
12th Dec 2017, 2:47 PM
Kartikey Sahu
Kartikey Sahu - avatar
14th Dec 2017, 10:27 AM
bedawang
bedawang - avatar
+ 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
11th Dec 2017, 7:35 PM
Jonathan Álex
Jonathan Álex - avatar
14th Dec 2017, 10:13 PM
Cluck'n'Coder
Cluck'n'Coder - avatar
+ 1
https://code.sololearn.com/c3CT9Z8hmjfa/?ref=app here we go
24th Dec 2017, 3:29 AM
Anjali Kushwaha
Anjali  Kushwaha - avatar