Tuesday, October 10, 2017

Toggle Alphabet Case

The program must accept an alphabet X and toggle the case (convert upper case to lower case and vice versa).

Input Format:
The first line denotes the value of character X.

Output Format:
The first line contains the characters X and the toggled case character separated by a hyphen.

Boundary Conditions: X is from a to z

Example Input/Output:
Input:
d
Output:
d-D

Solution:
s=input()
print(s+'-'+s.swapcase())
Share: