If you’re just asking about the syntax of the above, on one line it’d look like:
if Input.is_action_pressed("ui_up") or Input.is_action_pressed("ui_down") or Input.is_action_pressed("ui_cancel"):
print("hi")
But, since that can get hard to read, you can break it up into manageable chunks by wrapping the lines as long as you end each wrapped line with \, like:
if Input.is_action_pressed("ui_up") or \
Input.is_action_pressed("ui_down") or \
Input.is_action_pressed("ui_cancel"):
print("hi")