hi all,
is there any way to make this logic:
I need to make a statement one time only if the condition is false as below:
while 1:
statement1
statement2
if condition: --condition is true here
statement3
else --condition is false here
statement3 --I need to do this "statement3" one time only
if another condition:
break
what I mean that I need to send my data if speed > 3 else send my data only one time.
any help, please
I solved it. I just need to add extra "neverdone = True" to the solution of "Alex Martelli"
neverdone = True
while 1:
statement1
statement2
if condition:
statement3
neverdone = True
elif neverdone:
neverdone = False
statement3
if anothercondition:
break
many thanks to Alex Martelli.