DEV Community

dhanashekaran
dhanashekaran

Posted on

qwdwdaqd

did_something = False
for element in elements:
    if element.something:
        do_something()
        did_something = True
        break

if not did_something:
    do_something_else()
Enter fullscreen mode Exit fullscreen mode

`
did_something = False
for element in elements:
if element.something:
do_something()
did_something = True
break

if not did_something:
do_something_else()
`

Top comments (0)