Ottotos
Ottotos

Reputation: 673

Julia equivalent to "not" in python

I am new to Julia. I cannot find how to use a "not" operator as in python. What I want to do: run a while loop as long as a function returns false.

In python I would do:

while not function(foo, bar):
    do_something

How would you achieve this effect in Julia?

Upvotes: 2

Views: 1344

Answers (1)

Ulrich Thomas Gabor
Ulrich Thomas Gabor

Reputation: 6654

It's the standard !:

while !func(foo, bar)
    do_something
end

Upvotes: 4

Related Questions