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:
#
# 8a
#

def main():
    S = input()
    print(S.swapcase())


if __name__ == '__main__':
    main()

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:
input_str = input()

for i in input_str:
    if i.islower():
        print(i.upper(), end='')
    else:
        print(i.lower(), end='')
print()

Submission status: Accepted

Solution code:
import re

strings = input()


def swapletter(match):
    word = match.group()
    return word.swapcase()


data = re.sub(r"\w+", swapletter, strings)
print(data)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

ans = []
for c in s:
    if c.islower():
        ans.append(c.upper())
    elif c.isupper():
        ans.append(c.lower())
    else:
        ans.append(c)

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
sent = input()

s = sent.swapcase()
print(s)

Submission status: Accepted

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

n = input()
t = ""
for i in range(len(n)):
    m = str(n[i])
    if (n[i].islower()):
        m = n[i].upper()
    else:
        m = n[i].lower()
    t += m
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# // Input
# // 文字列が1行に与えられます。
# // Output
# // 与えられた文字列の小文字と大文字を入れ替えた文字列を出力して下さい。アルファベット以外の文字はそのまま出力して下さい。

line = 'fAIR, LATER, OCCASIONALLY CLOUDY.'
line = input()
output = ''
for i in range(len(line)):
    if line[i].isupper():
        output += line[i].lower()
    elif line[i].islower():
        output += line[i].upper()
    else:
        output += line[i]
print(output)

Submission status: Accepted

Solution code:
string = list(map(str, input()))
ans =[]
for char in string:
    if char.islower():
        ans.append(char.upper())
    elif char.isupper():
        ans.append(char.lower())
    else:
        ans.append(char)
    print(ans[-1], end="")
print()

Submission status: Accepted

Solution code:
n=input()
m=''

for i in range(len(n)):
    a=str(n[i])
    if(n[i].islower()):
        a=n[i].upper()
    elif(n[i].isupper()):
        a=n[i].lower()
    m+=a
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(open(0).read())
ss = []
for s in S:
    if 'a' <= s <= 'z':
        ss.append(s.upper())
    elif 'A' <= s <= 'Z':
        ss.append(s.lower())
    else:
        ss.append(s)
print("".join(ss), end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
buf = input()
buf_len = len(buf)

str_array = []
for i in range(buf_len):
    str_array.append(buf[i])

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

for i in range(buf_len):
    print("%s" % str_array[i], end="")

print()

Submission status: Accepted

Solution code:
str_list = list(input().split(","))
new_list=[]
for i in range(len(str_list)):
    f=[]
    for j in str_list[i]:
        if j.islower()==True:
            f.append(j.upper())
        elif j.isupper()==True:
            f.append(j.lower())
        else:
            f.append(j)
    new_list.append("".join(f))
for i in range(len(new_list)):
    if i==len(new_list)-1:
        print("{}".format(new_list[i]))
    else:
        print("{},".format(new_list[i]),end="")

Submission status: Accepted

Solution code:
test_string = input()

words = test_string.split(", ")
cases_switched_strings = []

for word in words:
    cases_switched_strings.append(word.swapcase())

output = ", ".join(cases_switched_strings)

print(output)

Submission status: Accepted

Solution code:
def resolve():
    s = input()

    ret = ""
    for c in s:
        if c.isupper():
            ret += c.lower()
        elif c.islower():
            ret += c.upper()
        else:
            ret += c
    print(ret)


resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
print(f'{s.swapcase()}')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
res=''
for i in s:
  if i.islower():
    i=i.upper()
  elif i.isupper():
    i=i.lower() 
  res+=i
print(res)

Submission status: Accepted

Solution code:
s = str(input())
t = ''
for c in s:
    if 65 <= ord(c) and ord(c) <= 90:
        t += c.lower()
    elif 97 <= ord(c) and ord(c) <= 122:
        t += c.upper()
    else:
        t += c
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
lc = s.lower()
uc = s.upper()

ans = ""
for i in range(len(s)):
    if s[i] == lc[i]:
        ans += uc[i]
    else:
        ans += lc[i]
print(ans)

Submission status: Accepted

Solution code:
#(53)大文字小文字変換
n=str(input())
print(n.swapcase())

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

def main():
    string = input()
    answer=""
    for s in string:
        if s.islower()==True:
            answer+=s.upper()
        elif s.isupper():
            answer+=s.lower()
        else:
            answer+=s
    print(answer)

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
def is_alphabet(s):
    if (0x41 <= ord(s) and ord(s) <= 0x5A) or (0x61 <= ord(s) and ord(s) <= 0x7A):
        return True
    else:
        return False


def is_upper(s):
    if 0x41 <= ord(s) and ord(s) <= 0x5A:
        return True
    else:
        return False


def is_lower(s):
    if 0x61 <= ord(s) and ord(s) <= 0x7A:
        return True
    else:
        return False


S = input().strip()
ans = ""

for s in S:
    if is_alphabet(s):
        if is_upper(s):
            ans += s.lower()
        else:
            ans += s.upper()
    else:
        ans += s

print(ans)

Submission status: Accepted

Solution code:
x = input()

str.swapcase(x)

print(str.swapcase(x))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

print(b)

Submission status: Accepted

Solution code:
#52 大文字変換

S = str(input())

swa = S.swapcase()

print(swa)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

i = input()

print(i.swapcase())

Submission status: Accepted

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

n = input()
print(n.swapcase())

Submission status: Accepted

Solution code:
strings = input()
result = ''

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

print(result)

Submission status: Accepted

Solution code:
a=input()


print(str.swapcase(a))

Submission status: Accepted

Solution code:
from string import ascii_lowercase, ascii_uppercase
s = input()
t = ''
for i in s:
    if i in ascii_uppercase:
        t += i.lower()
    elif i in ascii_lowercase:
        t += i.upper()
    else:
        t += i
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
cs = list(s)

for c in cs:
  if c.islower():
    print(c.upper(),end="")
  else :
    print(c.lower(),end="")
print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

print(s.swapcase())

Submission status: Accepted

Solution code:
s = input()

S = s.swapcase()

print(S)

Submission status: Accepted

Solution code:
strings = input()
for character in strings:
    if character.isupper():
        print(character.lower(), end="")
    else:
        print(character.upper(), end="")
print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

print(n.swapcase())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = str(input())
for i,b in enumerate(a):
    if b == a[i].upper():
        print(a[i].lower(),end='')
    else:
        print(a[i].upper(),end='')
print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
f = lambda c: c.swapcase() if c.isalpha() else c 


print("".join([f(c) for c in input()]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()

print(a.swapcase())

Submission status: Accepted

Solution code:
s = input()

print(str.swapcase(s))

Submission status: Accepted

Solution code:
s = input()

o = ""
for w in s:
    if w.isupper():
        o += w.lower()
    elif w.islower():
        o += w.upper()
    else:
        o += w
print(o)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

def main():
    s = input()
    print(s.swapcase(), end = "")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = str(input())

print(x.swapcase())

Submission status: Accepted

Solution code:
def invert_letter(letter):
    inv_letter=""
    for c in letter:
        inv_letter+=c.upper() if c.islower() else c.lower()
    return inv_letter

def run():
    letter_list=list(input().split())
    
    inv_letter_list=[]
    
    for letter in letter_list:
        inv_letter=invert_letter(letter)
        inv_letter_list.append(inv_letter)
        
    
    line_letter=" ".join(inv_letter_list)
    
    print(line_letter)

run()

Submission status: Accepted

Solution code:
s=input()
res=""
for t in s:
	if t.islower()==True:
		res+=t.upper()
	else:
		res+=t.lower()


print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = str(input())

print(a.swapcase())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
text=str(input())
t=''
for i in text:
    if i.isupper()==True:
        t+=i.lower()
    else:
       t+=i.upper()

print(t)

Submission status: Accepted

Solution code:
S = input()
ans = ""
for i in range(len(S)):
    if 97<=ord(S[i])<=122:
        ans += chr(65+int(ord(S[i]))-97)
    elif 65<=ord(S[i])<=90:
        ans += chr(97+int(ord(S[i]))-65)
    else:
        ans += S[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
def func2(x):
    if not x.isalpha():
        return x
    else:
        if x.isupper():
            return x.lower()
        else:
            return x.upper()
print("".join(map(lambda x:func2(x),sys.stdin.readline().rstrip())))

Submission status: Accepted

Solution code:
X = input()

for x in X:
    xx = x.upper()
    if x != xx:
        print(xx,end="")
    else:
        xxx = x.lower()
        if x != xxx:
            print(xxx,end="")
        else:
            print(x,end="")
print("")

Submission status: Accepted

Solution code:
s = input()


print(s.swapcase())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# 53

A = input()

print(A.swapcase())

Submission status: Accepted

Solution code:
a = str(input())

a = a.swapcase()

print(a)

Submission status: Accepted

Solution code:
n=str(input())

print(n.swapcase())

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
S=input()

print(S.swapcase())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    print(input().swapcase())

    return 0


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#1_8_A
x = str(input())
print(str.swapcase(x))

Submission status: Accepted

Solution code:
line = input()

for i in line:
    if i.isupper():
        print(i.lower(), end="")
    elif i.islower():
        print(i.upper(), end="")
    else:
        print(i,end="")
print("")

Submission status: Accepted

Solution code:
string = list(input())
trans = []

for c in string:
    if c.isupper():
        c = c.lower()
        
    elif c.islower():
        c = c.upper()
    else:
        None
    trans.append(c)

print("".join(trans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(input())
res = ''
for s in l:
    if s.isupper():
        res += s.lower()
    elif s.islower():
        res += s.upper()
    else:
        res += s
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
array = list(input())
leng = len(array)
answer = ["" for i in range(leng)]
for i in range(leng):
    if array[i].isupper():
        answer[i] = array[i].lower()
    elif array[i].islower():
        answer[i] = array[i].upper()
    else:
        answer[i] = array[i]
        
print("".join(map(str, answer)))

Submission status: Accepted

Solution code:
input = input()

for a in input:
    print(a.swapcase(),end='')
print('')

Submission status: Accepted

Solution code:
k = input()

print(f'{k}'.swapcase())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = ''
for i in input():
    if i.islower() == True:
        s += i.upper()
    elif i.isupper() == True:
        s += i.lower()
    else:
        s += i
print(s)

Submission status: Accepted

Solution code:
from sys import stdin
sentence = stdin.readline()

for char in sentence:
    if char.isalpha():
        if char.isupper():
            print(char.lower(), end='')
        elif char.islower():
            print(char.upper(), end='')
    else:        
        print(char, end='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

Sc = S.swapcase()
print(Sc)

Submission status: Accepted

Solution code:

text=input()
print(text.swapcase())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
s= input()

print(s.swapcase())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = str(input())
newstring = ""

for i in string:
    if (i.isupper()) == True:
        newstring += (i.lower())
    elif (i.islower()) == True:
        newstring += (i.upper())
    elif (i.isspace()) == True:
        newstring += i
    else:
        newstring += i

print(newstring)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = input()

print(l.swapcase())

Submission status: Accepted

Solution code:
lis=list(input().split())
l=""
for i in range(len(lis)-1):
    for j in lis[i]:
        if j==str.upper(j):
            l+=str.lower(j)
        else:
            l+=str.upper(j)
    print(l,end=" ")
    l=""
for k in lis[-1]:
    if k==str.upper(k):
            l+=str.lower(k)
    else:
        l+=str.upper(k)
print(l)

Submission status: Accepted

Solution code:
strings = input()


upSt = strings.upper()
dwSt = strings.lower()
for i in range(len(strings)):
    if strings[i] == upSt[i]:
        print(dwSt[i],end="")
    else :
        print(upSt[i],end="")
print("")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()

print(str.swapcase())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ls = list(map(str, input().split()))

for i, moji in enumerate(ls):
    for txt in moji:
        if txt.isupper():
            print(txt.lower(),end='')
        else:
            print(txt.upper(),end='')
    if i != len(ls)-1:
        print('' ,end=' ')
    else:
        print()

Submission status: Accepted

Solution code:

str = input()

print(str.swapcase())

Submission status: Accepted

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

print(s2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = ""

for s in S:
    if s.islower():
        ans += s.upper()
    elif s.isupper():
        ans += s.lower()

    else:
        ans += s

print(ans)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    string = input()

    print(string.swapcase())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string

def toggle_case(c):
    if not c in string.ascii_letters:
        return c
    return string.ascii_letters[(string.ascii_letters.index(c) + 26) % 52]

s = input()
print(''.join(map(toggle_case, s)))

Submission status: Accepted

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

print(S)

Submission status: Accepted

Solution code:
string = input()

string = string.swapcase()

print(string)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = input()

print(A.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()
tmp=''
for ch in S:
    if ch.islower():
        tmp += ch.upper()
    else:
        tmp += ch.lower()
print(tmp)

Submission status: Accepted

Solution code:
uw = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lw = "abcdefghijklmnopqrstuvwxyz"

S = list(input())
for i,a in enumerate(S):
    try:
        index = uw.index(a)
        S[i] = lw[index]
    except:
        try:
            index = lw.index(a)
            S[i] = uw[index]
        except:
            continue
print("".join(S))

Submission status: Accepted

Solution code:
s = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = a.upper()
c = a.lower()
ans = ''
for i in range(len(a)):
    if a[i] == b[i]:
        ans += c[i]
    else:
        ans += b[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=""
for s in input():
       # s.lower() if s.isupper()==True else s.upper() if s.islower()==True
    if s.isupper()==True:
        l+=s.lower()
    elif s.islower()==True:
        l+=s.upper()
    else:
        l+=s
print(l)

Submission status: Accepted

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

d = str(input())

d=d.swapcase()

print(d)

Submission status: Accepted

Solution code:

s = input()
t = ''
for w in s:
    if w.isupper():t+=w.lower()
    elif w.islower():t+=w.upper()
    else :t+=w
print (t)

Submission status: Accepted

Solution code:
import re
inp=input()
newInp=[]
for ch in inp:
#    print(ch)
#    print(ord(ch))
    if re.match(r"[a-z]", ch):
        #小文字は大文字に
        newInp.append(chr(ord(ch)-ord('a')+ord('A')))
    elif re.match(r"[A-Z]", ch):
        #大文字は小文字に
        newInp.append(chr(ord(ch)-ord('A')+ord('a')))
    else:
        newInp.append(ch)

print(''.join(newInp))

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:
import sys
input = sys.stdin.readline

def main():
    s = input().strip()

    for c in s:
        if "a" <= c and c <= "z":
            tmp = c.upper()
        elif "A" <= c and c <= "Z":
            tmp = c.lower()
        else:
            tmp = c
        print(tmp, end="")
    print()


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
sentence = input()

print(sentence.swapcase())

Submission status: Accepted

Solution code:
input_list = list(map(str,input().split(',')))

output_list = list()
for word in input_list:
    word = word.swapcase()
    output_list.append(word)

print(','.join(output_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ExchangeChar(c): 
  charNum = ord(c)
  if(ord("a") <= charNum and charNum <= ord("z")):
    return chr(charNum - 32) 
  elif(ord("A") <= charNum and charNum <= ord("Z")):
    return chr(charNum + 32)
  else:
    return c

words = list(input())
ans = []
for i in range(len(words)):
  ans.append(ExchangeChar(words[i]))

if(len(ans) == 1):
  print(ans[0])
else:
  for i in range(len(ans)-1):
    print(ans[i],end='')
  print(ans[i+1])

Submission status: Accepted

Solution code:
s = input()
res = ""

for i in range(len(s)):
    if 65 <= ord(s[i]) and ord(s[i]) <= 90:
        res += chr(ord(s[i]) + 32)
    elif 97 <= ord(s[i]) and ord(s[i]) <= 122:
        res += chr(ord(s[i]) - 32)
    else:
        res += s[i]

print(res)

Submission status: Accepted

Solution code:
strSen = input()
listSen = list(strSen)
pattern1 = 'abcdefghijklmnopqrstuvwxyz'
pattern2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(listSen)):
    if listSen[i] in pattern1:
        if i != len(listSen)-1:
            print(listSen[i].upper(), end = "")
        else:
            print(listSen[i].upper())
    elif listSen[i] in pattern2:
        if i != len(listSen)-1:
            print(listSen[i].lower(), end = "")
        else:
            print(listSen[i].lower())
    else:
        if i != len(listSen)-1:
            print(listSen[i], end = "")
        else:
            print(listSen[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c=list(map(str, input().split()))
r=[]
for i in c:
    r.append(i.swapcase())
print(*r)

Submission status: Accepted

Solution code:
a = str(input())

a = a.swapcase()

print(a)

Submission status: Accepted

Solution code:
s = input()
ls = s.lower()
us = s.upper()
ans = ""

for i in range(len(s)):
    if s[i] == ls[i]:
        ans += us[i]
    else:
        ans += ls[i]

print(ans)

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    cut = s[i : i + 1]
    if cut.isalpha() and cut.isupper():
        s = s[:i] + cut.lower() + s[i + 1 :]
    elif cut.isalpha() and cut.islower():
        s = s[:i] + cut.upper() + s[i + 1 :]

print(s)

Submission status: Accepted

Solution code:
def main(text):
    result = ''
    for t in text:
        if t.isupper():
            result += t.lower()
        elif t.islower():
            result += t.upper()
        else:
            result += t
    return result


if __name__ == "__main__":
    print(main(input()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

for i in range(len(S)):
    if S[i].isupper():
        S[i] = S[i].lower()
    else:
        S[i] = S[i].upper()
    
print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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