Initial commit
This commit is contained in:
7
Lab_3/lab3_1.py
Normal file
7
Lab_3/lab3_1.py
Normal 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
12
Lab_3/lab3_2.py
Normal 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")))
|
||||
Reference in New Issue
Block a user