
March 22, 2020
11:23 p.m.
Much appreciated! I will add that single quote and change those snippets to::
s = 'FooBar' * 100 + 'Baz' prefixes = ('Bar', 'Foo') while len(s) != len(s := s.cutprefix(prefixes)): pass s 'Baz'
and::
s = 'FooBar' * 100 + 'Baz' prefixes = ('Bar', 'Foo') while s.startswith(prefixes): s = s.cutprefix(prefixes) s 'Baz'