+ 1
Input:Python output: pYTHON
how to solve it friends ?
8 Réponses
+ 7
yeah @Ekansh, #Ruby is smart!
+ 6
or
...
b=input()
print(b[0].lower()+b[1:].upper())
+ 4
inp = input()
text = ""
for l in inp:
if l.isupper():
text += l.lower()
else:
text += l.upper()
print(text)
+ 3
Or a simple 1 liner:
[print(l.lower(), end="") if l.isupper() else print(l.upper(), end='') for l in input()]
+ 3
@Nomeh your code just makes the first character lowercase and the rest uppercase. I think what was wanted was for the case to be flipped. uppercase characters become lowercase and lowercase to uppercase.
+ 3
#Ruby
puts gets.swapcase
0
Mr.Dawg! thanks :)