Skip to content

Instantly share code, notes, and snippets.

@libert-xyz
Created July 2, 2016 18:06
Show Gist options
  • Save libert-xyz/53fe2cabfc65bb483a795c335cbc0aee to your computer and use it in GitHub Desktop.
Save libert-xyz/53fe2cabfc65bb483a795c335cbc0aee to your computer and use it in GitHub Desktop.
Your task is to swap cases. In other words, convert all lowercase letters to uppercase letters and vice versa. (Without swapcase() )
#7/2/16
#https://www.hackerrank.com/challenges/swap-case
s = [i.lower() if i.isupper() else i.upper() for i in raw_input()]
print ''.join(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment