$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #27

Fill the comparison so x becomes |a|.

x = a if a ____ 0 else -a   # absolute value

Answer: >= (also accepted: >=, >)

a if a >= 0 else -a returns the absolute value.
Play Problem Solving ▸