Sprawdź, czy sznur ma kwadratowe wsporniki Python

string = "This is a [sentence]"


first = string.find("[")


second = string.find("]")


print(string[first + 1:second])
Jittery Jay