+ 1
How does not works in boolean function
4 Antworten
+ 3
the code will run when the condition is true:
if True:
print("Hello")
# it will print
if not(False): # it is also True
print("hi")
# it will print
not is a logical operator that reverse the condition.
1 == 1 this condition is True because 1 is equals to 1, but when we use "not" operator it will become False.
not(1 == 1) # this is False
I don't know if I understood your question.
+ 1
What about loops
+ 1
A loop keeps running as long as the condition is True.
you can also use the "not operator" to reverse the condition of the loop.
0
Mafdi Ok thanks