Does Portugol have any ternary operators?
Example how it works in various languages:
algumaVar = 10 > 0 ? 8 : 4
Just out of curiosity, it would be interesting if it had.
Does Portugol have any ternary operators?
Example how it works in various languages:
algumaVar = 10 > 0 ? 8 : 4
Just out of curiosity, it would be interesting if it had.
It does not.
I will revisit the VisualGen references and do not talk about ternary operators.
It's a bit of an opinion, but I think it makes sense, since Portuguese is only used for teaching purposes, so it needs to be readable and compressible and the more explicit, the better to read.
To assert the non-existence of something, I must be a profound expert on the subject, which is not my case. But many materials on Portugol, some seemed very complete, and I never saw anything like it.
It makes sense because this operator is a convenience and in a learning language it does not make sense to have something like this.