This commit is contained in:
Patrik Tulach 2026-10-13 14:43:00 +02:00
parent 16e3eb2d8c
commit 567f057013

View File

@ -4,9 +4,12 @@ def is_paired(input_string):
search = []
for chr in input_string:
for i, chr in enumerate(input_string):
if chr in open:
search.append(close[open.index(chr)])
if i == len(input_string) -1:
return False
continue
if chr in (open + close):
@ -18,8 +21,4 @@ def is_paired(input_string):
else:
return False
return True
print(is_paired("() a[]b()c{[} [fds]gh"))
return True