Which is why I put it in quotes so that the OP could cut and paste and answer their own question

Quote

so i can look them up?

then come back here if there was anything they didn't understand.

(I teach SCUBA diving. All my students have survived, so I consider myself quite good at it)

I agree with you especially on the nutcases that shoot up schools. I'm a gun owner and people who do such terrible things make my hobby all the more difficult to enjoy (because all gun owners get lumped into the "psycho murderer" category).

Yes indeed. The question mark denotes the thing that happens if "X" is true and the colon denotes the thing that happens if "X" is false.

Here's an example (pseudo code):

what_is_larger = (moon < sun) ? "The sun" : "The moon"

The test condition is "moon less than sun". Since the moon is smaller than the sun, "(moon < sun)" evaluates to "TRUE". Therefore, the string after the QUESTION MARK is the one that is placed into the variable "what_is_larger".

I could also write it this way:

what_is_larger = (moon > sun) ? "The moon" : "The sun"

Since, in this case, "(moon > sun)" is FALSE, the string after the COLON is placed into the variable "what_is_larger".

Got it?

@Krupkski,@AWOL,

Thank you for your help, it makes perfect sense. The above explanation was very helpful. Is there any reason (other than succinctness) to use this as opposed to an if-else statement?