Problem:


Toggling Cases

  Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.

Input

  A string is given in a line.

Output

  Print the converted string in a line. Note that you do not need to convert any characters other than alphabetical letters.

Constraints

The length of the input string < 1200

Sample Input

fAIR, LATER, OCCASIONALLY CLOUDY.

Sample Output

Fair, later, occasionally cloudy.



Sample input:
fAIR, LATER, OCCASIONALLY CLOUDY.


Sample output:
Fair, later, occasionally cloudy.

Submission status: Accepted

Solution code:
import sys
import itertools
import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8').strip()
print(S.swapcase())

Submission status: Accepted

Solution code:
s = input()
LOWER = "abcdefghijklmnopqrstuvwxyz"
trans = {}
for i in range(len(LOWER)):
    trans[LOWER[i]] = str.upper(LOWER[i])
    trans[str.upper(LOWER[i])] = LOWER[i]
print(s.translate(str.maketrans(trans)))

Submission status: Accepted

Solution code:
s = input()

ans_s = ''
for c in s:
    if c.isupper():
        ans_s += c.lower()
    elif c.islower():
        ans_s += c.upper()
    else:
        ans_s += c

print(ans_s)

Submission status: Accepted

Solution code:
s = input()
s = str.swapcase(s)
print(s)

Submission status: Accepted

Solution code:
s = str(input())
for i in s:
  if i.islower():
    print(i.upper(),end="")
  else:
    print(i.lower(),end="")
print()

Submission status: Accepted

Solution code:
s = input().swapcase()
print(s)

Submission status: Accepted

Solution code:
s = str(input())
l = len(s)
s = list(s)
for i in range (l):
    if 97 <= ord(s[i]) <= 122:
        s[i] = chr(ord(s[i]) - 32)
    elif 65 <= ord(s[i]) <= 90:
        s[i] = chr(ord(s[i]) + 32)
s = "".join(s)
print(s)

Submission status: Accepted

Solution code:
s = list(input())

for _s in s:
    print(_s.lower() if _s.isupper() else _s.upper(), end="")
print()

Submission status: Accepted

Solution code:
sl = list(input())
ans = []
for s in sl:
    if s.isupper() == True:
        ans.append(s.lower())
    elif s.islower() == True:
        ans.append(s.upper())
    else:
        ans.append(s)

print(*ans, sep='')

Submission status: Accepted

Solution code:
s=input()
print(str.swapcase(s))

Submission status: Accepted

Solution code:
strs = list(input().split())

rev_strs = [s.swapcase() for s in strs]
print(" ".join(rev_strs))

Submission status: Accepted

Solution code:
S=input()
for i in range(len(S)):
    if S[i].upper()!=S[i]:
        print(S[i].upper(),end="")
    elif S[i].lower()!=S[i]:
        print(S[i].lower(),end="")
    else:
        print(S[i],end="")
print("")

Submission status: Accepted

Solution code:
s = input()

new_s = ""

for i in range(len(s)):
    char = s[i : i + 1]
    if char.islower():
        new_s += char.upper()
    elif char.isupper():
        new_s += char.lower()
    else:
        new_s += char

print(new_s)

Submission status: Accepted

Solution code:
moji = input()

print(moji.swapcase())

Submission status: Accepted

Solution code:
S = list(input())
for i in range(len(S)):
    if 65 <= ord(S[i]) < 65+26:
        S[i] = S[i].lower()
    elif 97 <= ord(S[i]) < 97+26:
        S[i] = S[i].upper()
print(''.join(S))

Submission status: Accepted

Solution code:
n=input()
m=''
for i in range(len(n)):
    c=str(n[i])
    if(n[i].islower()):
        c=n[i].upper()
    elif(n[i].isupper()):
        c=n[i].lower()
    m+=c
print(m)

Submission status: Accepted

Solution code:
str_x = input()
print(str_x.swapcase())

Submission status: Accepted

Solution code:
s = input()
ans = ""
for i in range(len(s)):
    if s[i].isupper():
        ans += s[i].lower()
    else:
        ans += s[i].upper()
print(ans)

Submission status: Accepted

Solution code:
input_data = str(input())
print(input_data.swapcase())

Submission status: Accepted

Solution code:
S=input()
print(S.swapcase())

Submission status: Accepted

Solution code:
A = input()
print(A.swapcase())

Submission status: Accepted

Solution code:
word = str(input())
word = str.swapcase(str(word)) #大文字と小文字を変換

print("".join(word))

Submission status: Accepted

Solution code:
for c in input():
	l = c.lower()
	u = c.upper()
	if c != l:
		print(l, end="")
	elif c!= u:
		print(u, end="")
	else:
		print(c, end="")
print("")

Submission status: Accepted

Solution code:
# インプットデータを変数に代入
inp = input()

# 処理実行
result = ""
for i in inp:
    upr = i.upper()
    lwr = i.lower()
    if upr != i:
        result += upr
    else:
        result += lwr
print(result)

Submission status: Accepted

Solution code:
x = input()
xResult = ''

for i in range(len(x)):
    xSw = True
    y = x[i:i+1]
    yU = y.upper()
    yL = y.lower()
    
    if y == yU:
        y = yL
    else:
        y = yU

    xResult = xResult + y
    
print(xResult)

Submission status: Accepted

Solution code:
a=raw_input()
print (a.swapcase())

Submission status: Accepted

Solution code:
import re


def flip_case(char):
    if re.match(r"[a-zA-Z]", char):
        return char.upper() if char.islower() else char.lower()
    else:
        return char


s = input()
ans = []
for c in s:
    ans.append(flip_case(c))
print("".join(ans))

Submission status: Accepted

Solution code:
def toggling_string(string):

    dummy = string.lower()
    res = list()
    
    for i in range(len(dummy)):
        if dummy[i] == string[i]:
            res.append(dummy[i].upper())
        else:
            res.append(dummy[i].lower())

    print("".join(res))

if __name__ == "__main__":
    
    sentence = input()
    toggling_string(sentence)

Submission status: Accepted

Solution code:
l = input()
print(l.swapcase())

Submission status: Accepted

Solution code:
letter = input()
output = ''

for l in letter:
    if l.isupper():
        l = l.lower()
    else:
        l = l.upper()
        
    output += l

print(output)

Submission status: Accepted

Solution code:
S = input()
r = ""
for s in S:
    if ord("a") <= ord(s) <= ord("z"):
        r += chr(ord(s) - 32)
    elif ord("A") <= ord(s) <= ord("Z"):
        r += chr(ord(s) + 32)
    else:
        r += s
print(r)

Submission status: Accepted

Solution code:
words = str(input())
print(words.swapcase())

Submission status: Accepted

Solution code:
given_string = input()

print(given_string.swapcase())

Submission status: Accepted

Solution code:
a = str(input())
a = a.swapcase()
print(a)

Submission status: Accepted

Solution code:
s = input()
  
r = ""
for c in s:
    if c.isupper():
        r += c.lower()
    elif c.islower():
        r += c.upper()
    else:
        r += c

print(r)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    #h0,w0h1,w1 = map(int, input().split())
    s=input()
    ans=""
    for c in s:
        oc=ord(c)
        if c.isupper():
            ans+=c.lower()
        elif c.islower():
            ans+=c.upper()
        else:
            ans+=c
    print(ans)

main()

Submission status: Accepted

Solution code:
s = input()
s = s.swapcase()

print(s)

Submission status: Accepted

Solution code:
T = input()
print(T.swapcase())

Submission status: Accepted

Solution code:
S = input()

ans = ''
for s in S:
    ans += s.lower() if s.isupper() else s.upper()

print(ans)

Submission status: Accepted

Solution code:
s=input()
ans=''
for i in s:
    if i.upper()==i:
        ans+=i.lower()
    else:
        ans+=i.upper()
print(ans)

Submission status: Accepted

Solution code:
setup=input()
c=""
for i in range(len(setup)):
    tmp_setup=""
    m=str(setup[i])
    tmp_setup=m.upper()
    if  m==tmp_setup:
        tmp_setup=m.lower()
    c=c+tmp_setup
print(c)

Submission status: Accepted

Solution code:
s = input()
for i in s:
    if i.isupper():
        print(i.lower(), end='')
    else:
        print(i.upper(), end='')
print()

Submission status: Accepted

Solution code:
S = input()
buf = []
for i in range(len(S)):
    if S[i].islower():
        buf.append(S[i].upper())
    elif S[i].isupper():
        buf.append(S[i].lower())
    else:
        buf.append(S[i])
print("".join(buf))

Submission status: Accepted

Solution code:
a_str=input()
print(a_str.swapcase())

Submission status: Accepted

Solution code:
x=input()
ans=''
for i in x:
    if i.isupper():
        ans+=i.lower()
    else:
        ans+=i.upper()
print(ans)

Submission status: Accepted

Solution code:
s  = input()
r = ''
for i in s:
    if i == i.upper():
        r += i.lower()
    else:
        r += i.upper()

print(r)

Submission status: Accepted

Solution code:
s = input()
r = ''
for _ in s:
    if (('A' <= _) and (_ <= 'Z')):
        r += chr(ord(_) + (ord('a') - ord('A')))
    elif ('a' <= _ and _ <= 'z'):
        r += chr(ord(_) - (ord('a') - ord('A')))
    else:
        r += _
print(r)

Submission status: Accepted

Solution code:
contents=str(input())
print(contents.swapcase())

Submission status: Accepted

Solution code:
name = str(input())

ans = str.swapcase(name)
print(ans)

Submission status: Accepted

Solution code:
a = str(input())
print(a.swapcase())

Submission status: Accepted

Solution code:
x = input()
listA=[]
for i in range(len(x)):
    if x[i].islower():
        listA.append(x[i].upper())
    else:
        listA.append(x[i].lower())
        
print("".join(listA))

Submission status: Accepted

Solution code:
string = input()
st = str()
for s in string:
    if s.isalpha():
        if s.islower():
          
            s = s.upper()
        else:
            
            s = s.lower()
    else:pass
 
    st += s

print(st)

Submission status: Accepted

Solution code:
S = input()
s = ""
for i in range(len(S)):
    if S[i] == S[i].upper():
        s += S[i].lower()
    else:
        s += S[i].upper()
print(s)

Submission status: Accepted

Solution code:
x = input()
x = x.swapcase()
print(x)

Submission status: Accepted

Solution code:
letters=input()
print(letters.swapcase())

Submission status: Accepted

Solution code:
a=input()
b=a.upper()
c=a.lower()
ans=""
for i,j,k in zip(a,b,c):
    if i==j and j==k:
        ans+=i
    elif i==j:
        ans+=k
    else:
        ans+=j
print(ans)

Submission status: Accepted

Solution code:
line = input()

result = ''

for char in line:
    if char.isupper():
        char = char.lower()
    elif char.islower():
        char = char.upper()
    result += char

print(result)

Submission status: Accepted

Solution code:
t = input()
print(t.swapcase())

Submission status: Accepted

Solution code:
x = input()
for i in x:
    if i.islower():
        print(i.upper(), end='')
    else:
        print(i.lower(), end='')
print()

Submission status: Accepted

Solution code:
import re

# Input
words = list(input().split(' '))

# Loops
new = []
for word in words:
    new_word = ''
    for ch in word:
        if re.match('[a-z]', ch):
            new_word = new_word + ch.upper()
        elif re.match('[A-Z]', ch):
            new_word = new_word + ch.lower()
        else:
            new_word = new_word + ch
    new.append(new_word)

# Output
for i in range(len(new)-1):
    print(new[i], end=' ')
print(new[-1])

Submission status: Accepted

Solution code:
import string
strings = list(input())
uppers = string.ascii_uppercase
lowers = string.ascii_lowercase

for i in range(len(strings)):
    if strings[i] in uppers:
        strings[i] = str.lower(strings[i])
    elif strings[i] in lowers:
        strings[i] = str.upper(strings[i])

print(''.join(map(str, strings)))

Submission status: Accepted

Solution code:
s = list(input())
for i in range(len(s)):
    s[i] = s[i].upper() if s[i].islower() else s[i].lower()
print("".join(s))

Submission status: Accepted

Solution code:
A = input()
ans = ''

for i in A:
    if i.isupper() == True:
        ans += i.lower()
    else:
        ans += i.upper()

print(ans)

Submission status: Accepted

Solution code:
n = str(input())
print(n.swapcase())

Submission status: Accepted

Solution code:
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
dic = {c: alphabet[(i + 26) % 52] for i, c in enumerate(alphabet)}

s = input()
for c in s:
    if c in alphabet:
        print(dic[c], end='')
    else:
        print(c, end='')

print()

Submission status: Accepted

Solution code:
s=input()
print(s.swapcase())

Submission status: Accepted

Solution code:
for c in list(input()):
    if str.isupper(c):
        print(str.lower(c),end='')
    elif str.islower(c):
        print(str.upper(c),end='')
    else:
        print(c,end='')
print()

Submission status: Accepted

Solution code:
s =input()
print(s.swapcase())

Submission status: Accepted

Solution code:
txt = input()
ans = ''

for t in txt:
    if t.isupper():
        ans += t.lower()
    elif t.islower():
        ans += t.upper()
    else:
        ans += t

print(ans)

Submission status: Accepted

Solution code:
a=print(str.swapcase(input()))

Submission status: Accepted

Solution code:
ins=input()
l=len(ins)
#print(l)
ans=""
for i in range(l):
    oi = ord(ins[i])
    if oi>=65 and oi<=90:
        oo = oi + 32
    elif oi>=97 and oi<=122:
        oo = oi -32
    else:
        oo = oi
    ans = ans + chr(oo)
print(ans)

Submission status: Accepted

Solution code:
line = input()

new = ""
for i in range(len(line)):
    if line[i].islower():
        new += line[i].upper()
    elif line[i].isupper():
        new += line[i].lower()
    else:
        new += line[i]

print(new)

Submission status: Accepted

Solution code:
a=list(input())
for x in a:
	if ord(x) >= 97 and ord(x) <=123:
		x=chr(ord(x)-32)
	elif ord(x) >= 65 and ord(x) <=91:
		x=chr(ord(x)+32)
	print(x,end="")
print()

Submission status: Accepted

Solution code:
def test():

	string = list(input())

	for i in range(len(string)):

		# small character
		if ord('a') <= ord(string[i]) and ord(string[i]) <= ord('z'):
			string[i] = chr(ord(string[i]) - 0x20)
		#big character
		elif ord('A') <= ord(string[i]) and ord(string[i]) <= ord('Z'):
			string[i] = chr(ord(string[i]) + 0x20)

	print(''.join(string))

if __name__ == "__main__":
	test()

Submission status: Accepted

Solution code:
input_str = input()
print(input_str.swapcase())

Submission status: Accepted

Solution code:
n = str(input())
print(n.swapcase())

Submission status: Accepted

Solution code:
a=list(input())
for x in a:
	if ord(x) >= 97 and ord(x) <=123:
		x=chr(ord(x)-32)
	elif ord(x) >= 65 and ord(x) <=91:
		x=chr(ord(x)+32)
	print(x,end="")
print()

Submission status: Accepted

Solution code:
fair = input()
ans =''

for i in fair:
    if i == i.lower():
        ans += i.upper()
    else:
        ans += i.lower()
    
print(ans)

Submission status: Accepted

Solution code:
S = input()

ans = ""
for c in S:
    if c.islower():
        ans += c.upper()
    else:
        ans += c.lower()

print(ans)

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    if (s[i].isupper()):
        print(s[i].lower(), end="")
    elif (s[i].islower()):
        print(s[i].upper(), end="")
    else:
        print(s[i], end="")
print()

Submission status: Accepted

Solution code:
s=list(input())

for c in map(ord,s):
	if ord('A') <= c and c <= ord('Z'):
		print(chr(c+(ord('a'))-ord('A')),end="")
	elif ord('a') <= c and c <= ord('z'):
		print(chr(c+(ord('A')-ord('a'))),end="")
	else:
		print(chr(c),end="")
print()

Submission status: Accepted

Solution code:
import sys
 
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
 
 
buf = str(input())
print(buf.swapcase())

Submission status: Accepted

Solution code:
s = "abcdefghijklmnopqrstuvwxyz"
S = s.upper()
ans = ""
for i in input():
    if i in s:
        ans += i.upper()
    elif i in S:
        ans += i.lower()
    else:
        ans += i
print(ans)

Submission status: Accepted

Solution code:
import sys,os,re
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations
sys.setrecursionlimit(10**6)

s=list(input())
for i in range(len(s)):
    if s[i]==s[i].lower():
        s[i]=s[i].upper()
    else:
        s[i]=s[i].lower()
print("".join(s))

Submission status: Accepted

Solution code:
st=input()
b=st.swapcase()
print(b)

Submission status: Accepted

Solution code:
s = str(input())
ans = ''
for i in range(len(s)):
    tmp = s[i]
    if 'A'<=s[i]<='Z':
        ans += tmp.lower()
    elif 'a'<=s[i]<='z':
        ans += tmp.upper()
    else:
        ans += tmp
print(ans)

Submission status: Accepted

Solution code:
print(str(input().swapcase()))

Submission status: Accepted

Solution code:
alphabet_lowercase = [chr(i) for i in range(97, 97 + 26)]
alphabet_uppercase = [chr(i) for i in range(65, 65 + 26)]

input_string = input()
output_string = ""
for s in input_string:
    if s in alphabet_lowercase:
        output_string += alphabet_uppercase[alphabet_lowercase.index(s)]
    elif s in alphabet_uppercase:
        output_string += alphabet_lowercase[alphabet_uppercase.index(s)]
    else:
        output_string += s

print(output_string)

Submission status: Accepted

Solution code:
s=input()
for c in s:
	a=(ord(c))
	if a>=65 and a<=90:
		a+=32
		print(chr(a),end='')
	elif a>=97 and a<=97+25:
		a-=32
		print(chr(a),end='')
	else:
		print(c,end='')
print()

Submission status: Accepted

Solution code:
string=input()
new_string=""
for s in string:
    if 'a'<=s<='z':
        new_string+=s.upper()
    elif 'A'<=s<='Z':
        new_string+=s.lower()
    else:
        new_string+=s
print(new_string)

Submission status: Accepted

Solution code:
import sys

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


buf = str(input())
print(buf.swapcase())

Submission status: Accepted

Solution code:
text = input()
ans = ""
for w in text:
    if w.isupper() == True:
        ans += w.lower()
    elif w.islower() == True:
        ans += w.upper()
    else:
        ans += w

print(ans)

Submission status: Accepted

Solution code:
line = input()

for ch in line:
    if ord('a') <= ord(ch) <= ord('z'):
        ch = chr(ord(ch)-32)
    elif ord('A') <= ord(ch) <= ord('Z'):
        ch = chr(ord(ch)+32)

    print(ch, end='')

print()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    input_str = input()
    print("".join([s.upper() if s.islower() else s.lower() for s in input_str]))

Submission status: Accepted

Solution code:
a = [s for s in input().split()]

b = []
for i in range(len(a)):
    b.append(list(a[i]))
    
for i in range(len(b)):
    for j in range(len(b[i])):
        if b[i][j].isupper() == True:
            b[i][j] = b[i][j].lower()
        elif b[i][j].islower() == True:
            b[i][j] = b[i][j].upper()
    b[i] = "".join(b[i])
b = " ".join(b)
print(b)

Submission status: Accepted

Solution code:
string = input()
print(string.swapcase())

Submission status: Accepted

Solution code:
s=input()
for c in s:
  if 'A' <= c and c <= 'Z':
    print(c.lower(),end='')
  elif 'a' <= c and c <= 'z':
    print(c.upper(),end='')
  else:
    print(c,end='')
print()

Submission status: Accepted

Solution code:
# coding=utf-8

###
### for atcorder program
###

import sys
import math
import array

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

def main():

    N = input()

    for i, row in enumerate(N):
        if row.isupper() == True:
            N = N[:i] + row.lower() + N[i+1:]
        elif row.islower() == True:
            N = N[:i] + row.upper() + N[i+1:]

    print(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
string = input()
ans = ""
for s in string:
    if s.isupper():
        ans += s.lower()
    else:
        ans += s.upper()
print(ans)

Submission status: Accepted

Solution code:
string = input()

for c in string:
    if c.isupper():
        print(c.lower(), end='')
    elif c.islower():
        print(c.upper(), end='')
    else:
        print(c, end='')
print()

Submission status: Accepted

Solution code:
a = str(input())

print(str.swapcase(a))

Submission status: Accepted

Solution code:
s=input()
for i in s:
    if i==i.lower():
        print(i.upper(),end='')
    else:
        print(i.lower(),end='')
print()

Submission status: Accepted

Solution code:
str= input()
print(str.swapcase())

Submission status: Accepted

Solution code:
for c in input():
    if c.isupper():
        print(c.lower(), end='')
    else:
        print(c.upper(), end='')
        
print()

Submission status: Accepted

Solution code:
s = input()
t = s.swapcase()
print(t)

Submission status: Accepted

Solution code:
str = input()
list = list(str)

for i in range(len(list)):
    if list[i].isupper():
        list[i] = list[i].lower()
    else:
        list[i] = list[i].upper()

print("".join(list))

Submission status: Accepted

Solution code:
#ITP1_8_A
A=input()
print(A.swapcase())

Submission status: Accepted

Solution code:
s = input()
 
print(s.swapcase())

Submission status: Accepted

Solution code:
s = input()
 
for c in s:
    if c.islower():
        print(c.upper(), end="")
    else:
        print(c.lower(), end="")
print()

Submission status: Accepted

Solution code:
target=input()
x=target.swapcase()
print(x)

Submission status: Accepted

Solution code:
L=input()
M=L.swapcase()
print(M)

Submission status: Accepted

Solution code:
st = input()

print(str.swapcase(st))

Submission status: Accepted

Solution code:
#from numpy import*
#from scipy import*
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby
from operator import mul
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
#input=sys.stdin.readline  #危険！基本オフにしろ！
sys.setrecursionlimit(10**6)


def main():
    print(input().swapcase())
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
moji = str(input())
print(moji.swapcase())

Submission status: Accepted

Solution code:
def toggle_case(c):
    ascii_code = ord(c)
    if 65 <= ascii_code <= 90:
        return chr(ascii_code + 32)
    elif 97 <= ascii_code <= 122:
        return chr(ascii_code + -32)
    
    return c

res = list(input())
res = [toggle_case(c) for c in res]
print("".join(res))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	s = input()
	print("%s" % (s.swapcase()))

Submission status: Accepted

Solution code:
x = input()
ans = ''
for v in x:
    if str.isupper(v):
        ans += str.lower(v)
    elif str.islower(v):
        ans += str.upper(v)
    else:
        ans += v
print(ans)

Submission status: Accepted

Solution code:
string = input()
print(str.swapcase(string))

Submission status: Accepted

Solution code:
print(''.join(c.upper() if c.islower() else c.lower() for c in input()))

Submission status: Accepted

Solution code:
x = input()
x = x.swapcase()

print(x)

Submission status: Accepted

Solution code:
# 大文字を小文字に、小文字を大文字に変換
print(input().swapcase())

Submission status: Accepted

Solution code:
s1 = input()
s2 = ''
for c in s1:
    if ord('a') <= ord(c) <= ord('z'):
        c0 = chr(ord(c) - ord('a') + ord('A'))
    elif ord('A') <= ord(c) <= ord('Z'):
        c0 = chr(ord(c) - ord('A') + ord('a'))
    else:
        c0 = c
    s2 += c0
print(s2)

Submission status: Accepted

Solution code:
Str = input().strip().split()
Str_len = len(Str)

for i in range(Str_len):
    Str[i] = Str[i].swapcase()

Str = ' '.join(Str)
print(Str)

Submission status: Accepted

Solution code:
str1 = input()
print(str1.swapcase())

Submission status: Accepted

Solution code:
l = input()
s_l = l.swapcase()
print(s_l)

Submission status: Accepted

Solution code:
T = input()

print(T.swapcase())

Submission status: Accepted

Solution code:
inp = input()
print(inp.swapcase())

Submission status: Accepted

Solution code:
moji=str(input())
print(moji.swapcase())

Submission status: Accepted

Solution code:
str = input()
swap = ""
for ch in str:
    if ch.isupper():
        c = ch.lower()
    elif ch.islower():
        c = ch.upper()
    else:
        c = ch
    swap += c

print(swap)

Submission status: Accepted

Solution code:
str1 = input()
for i in str1:
    if i.isupper():
        print(i.lower(), end = "")
    elif i.islower():
        print(i.upper(), end = "")
    else:
        print(i, end = "")
print()

Submission status: Accepted

Solution code:
data = input()
output = []
for i in data:
  if i.islower():
    output.append(i.upper())
  else:
    output.append(i.lower())

for i in output:
  print(i, end="")

print()

Submission status: Accepted

Solution code:
buf = str(input())

print(buf.swapcase())

Submission status: Accepted

Solution code:
iw = str(input())
ow=[]

s="abcdefghijklmnopqrstuvwxyz"
l="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in iw:
    if i in s:
        ow1=l[s.index(i)]
    elif i in l:
        ow1=s[l.index(i)]
    else:
        ow1=i
    ow.append(ow1)

print("".join(ow))

Submission status: Accepted

Solution code:
c = input()
c = str.swapcase(c)
print(c)

Submission status: Accepted

Solution code:
A = input()
for i in A:
    if i.isalpha():
       print(i.swapcase(), end = '')
    else:
        print(i, end='')
print()

Submission status: Accepted

Solution code:
strin =input()
print(strin.swapcase())

Submission status: Accepted

Solution code:
s = input()
print (s.swapcase())

Submission status: Accepted

Solution code:
a= str(input())
a= str.swapcase(a)
print(a)

Submission status: Accepted

Solution code:
# coding: utf-8
line = input()
print(line.swapcase())

Submission status: Accepted

Solution code:
print(''.join(map(lambda x: [x.upper(), x.lower()][x.isupper()], input())))

Submission status: Accepted

Solution code:
s = input()
for i in s:
    if ord('A') <= ord(i) <= ord('Z'):
        print(chr(ord(i)+32) ,end = '')
    elif ord('a') <= ord(i) <= ord('z'):
        print(chr(ord(i)-32) ,end = '')
    else:
        print(i ,end = '')
print('')

Submission status: Accepted

Solution code:
strList = input()
print(strList.swapcase())

Submission status: Accepted

Solution code:
sent = input()
nsent = ""
for c in sent:
    if ord("a") <= ord(c) and ord(c) <= ord("z"):
        nsent += chr(ord(c) + ord("A") - ord("a"))
    elif ord("A") <= ord(c) and ord(c) <= ord("Z"):
        nsent += chr(ord(c) + ord("a") - ord("A"))
    else:
        nsent += c

print(nsent)

Submission status: Accepted

Solution code:
sentence = str(input())
print(sentence.swapcase())

Submission status: Accepted

Solution code:
str = input()
str2 = str.swapcase()
print(str2)

Submission status: Accepted

Solution code:
import sys

a = str(input())
print(a.swapcase())

Submission status: Accepted

Solution code:
S = input()

for i in range(len(S)):
    tmp = S[i]
    if tmp.islower():
        tmp = tmp.upper()
    else:
        tmp = tmp.lower()

    print(tmp, end="")

print()

Submission status: Accepted

Solution code:
cap = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
lower = list("abcdefghijklmnopqrstuvwxyz")
dic = dict(zip(cap+lower, lower+cap))
tex = input()
out = [dic[i] if i in dic else i for i in tex]
print("".join(out))

Submission status: Accepted

Solution code:
inStr = input()
outStr = inStr.swapcase()
print(outStr)

Submission status: Accepted

Solution code:
import sys
import string

trans = str.maketrans(
    string.ascii_lowercase + string.ascii_uppercase,
    string.ascii_uppercase + string.ascii_lowercase
)

print(sys.stdin.read().translate(trans), end='')

Submission status: Accepted

Solution code:
string = input()
answer = ''
for ch in string:
    if ch.isupper():
        answer += ch.lower()
    elif ch.islower():
        answer += ch.upper()
    else:
        answer += ch
print(answer)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

letters = input()
print(letters.swapcase())

Submission status: Accepted

Solution code:
print (str(input()).swapcase())

Submission status: Accepted

Solution code:
moji = input()
print(moji.swapcase())

Submission status: Accepted

Solution code:
s = input()

print(s.swapcase())

Submission status: Accepted

Solution code:
inline = str(input())
print(inline.swapcase())

Submission status: Accepted

Solution code:
A=input().split()
B=[A[i].swapcase() for i in range(0,len(A))]
print(" ".join(B))

Submission status: Accepted

Solution code:
s = input()
for c in s:
    if c.isupper():
        print(c.lower(), end="")
    elif not c.isalpha():
        print(c, end="")
    else:
        print(c.upper(), end="")
print()

Submission status: Accepted

Solution code:
a=input()
b=a.swapcase()
print(b)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

# ITP1_8_A

N = input()
result = [string.swapcase() for string in N] 
print("".join(result))

Submission status: Accepted

Solution code:
for c in input():
    if 'a'<=c<='z':
        print(chr(ord(c)^0x20), end='')
    elif 'A'<=c<='Z':
        print(chr(ord(c)|0x20), end='')
    else:
        print(c, end='')
print()

Submission status: Accepted

Solution code:
str_row = input()
print(str_row.swapcase())

Submission status: Accepted

Solution code:
array = input().split(',')
ans = [ary.swapcase() for ary in array]
print(','.join(ans))

Submission status: Accepted

Solution code:
a = input()

print(a.swapcase())

Submission status: Accepted

Solution code:
A = list(map(str,input().split(", ")))
for i in range(len(A)):
    A[i] = A[i].swapcase()

word = A[0]
for k in range(1,len(A)):
    if k < len(A):
        word = word +", "+str(A[k])
    else:
        word = word + str(A[k])
print(word)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

if __name__ == '__main__':
    s = map(ord, list(raw_input()))
    for i in range(len(s)):
        if s[i] > 0x40 and (s[i]-0x41)%0x20 < 0x1a:
            s[i]^=0x20
    print ''.join(map(chr, s))

Submission status: Accepted

Solution code:
n = input().rstrip()
print(n.swapcase())

Submission status: Accepted

Solution code:
letter = input()
print(letter.swapcase())

Submission status: Runtime Error

Solution code:
https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/7/ITP1_7_D

Submission status: Runtime Error

Solution code:
string=input()
print(string.swapcase()

Submission status: Runtime Error

Solution code:
Target=input()
Target.swapcases()
print(Target)