Initial commit

This commit is contained in:
2024-03-09 17:38:18 +02:00
parent 9009a146f1
commit 73f5354da2
19 changed files with 1977 additions and 0 deletions

7
Lab_3/lab3_1.py Normal file
View File

@@ -0,0 +1,7 @@
text = input("Введіть ваш рядок: ").split()
if not text:
print("Ви ввели пустий рядок, спробуйте ще раз.")
exit()
print("Ваш рядок без зайвих пробілів: {}".format(" ".join(text)))

12
Lab_3/lab3_2.py Normal file
View File

@@ -0,0 +1,12 @@
inp = bytes(input("Введіть вашу послідовність: "), encoding="utf-8")
if not inp:
print("Ви ввели пусту послідовність, спробуйте ще раз.")
exit()
inp = inp.replace(b"<#s>", b"<#>")
inp = inp.replace(b"<#S>", b"<#>")
inp = inp.replace(b"<S>", b"<#s>")
inp = inp.replace(b"<s>", b"<#s>")
print("Ваша послідовність після редагування: {}".format(inp.decode("utf-8")))