Consider this:
if (check):
do_something()
This should be written as:
if check:
do_something()
That is, you don't need to put stuff in brackets. This will apply to while statements as well, as one other example.
Consider this:
if (check):
do_something()
This should be written as:
if check:
do_something()
That is, you don't need to put stuff in brackets. This will apply to while statements as well, as one other example.