Input Format
A single line containing a string .
Constraints
Output Format
Print the modified string .
hackerrank swap case problem solution in python

Problem solution in python 2 programming language.

import string
print string.swapcase(raw_input())

Problem solution in python 3 programming language.

import string
print string.swapcase(input())

Second solution

def swap_case(s):
    return s.swapcase()
if __name__ == '__main__':
    s = input()
    result = swap_case(s)
    print(result)