A:
Кратко:
print(input()[::-1].strip())
Развёрнуто:
string = input()
modified_string = string[::-1]
modified_string = modified_string.strip()
print(modified_string)
B:
chars = list(input())
newStr = ''
for i in range(len(chars)):
if chars[i] == 'а':
newStr += 'б'
elif chars[i] == 'А':
newStr += 'Б'
elif chars[i] == 'б':
newStr += 'а'
elif chars[i] == 'Б':
newStr += 'А'
else:
newStr += chars[i]
print(newStr)
stroka = input("Введи строку: ")
print(stroka[::-1].strip())
В:
new_stroka = ''
letters = {'а': 'б', 'А': 'Б', 'б': 'а', 'Б': 'А'} # пары букв для замены
for symb in stroka:
new_stroka += letters.get(symb, symb)
print(new_stroka)
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
A:
Кратко:
print(input()[::-1].strip())
Развёрнуто:
string = input()
modified_string = string[::-1]
modified_string = modified_string.strip()
print(modified_string)
B:
chars = list(input())
newStr = ''
for i in range(len(chars)):
if chars[i] == 'а':
newStr += 'б'
elif chars[i] == 'А':
newStr += 'Б'
elif chars[i] == 'б':
newStr += 'а'
elif chars[i] == 'Б':
newStr += 'А'
else:
newStr += chars[i]
print(newStr)
A:
stroka = input("Введи строку: ")
print(stroka[::-1].strip())
В:
stroka = input("Введи строку: ")
new_stroka = ''
letters = {'а': 'б', 'А': 'Б', 'б': 'а', 'Б': 'А'} # пары букв для замены
for symb in stroka:
new_stroka += letters.get(symb, symb)
print(new_stroka)