Stage 2 — collecting non-Go launches JAJackStackOP 11 Sep, 07:54 How do I print them on one line after the Go ones?
SASamPrice11 Sep, 09:06replies: 2Collect them in a list during the same loop (formatted as "name (status)"), then after the loop join them with ", ". If the list is empty, print "none".
MAMateoG11 Sep, 15:17Comparing status — make sure it's exactly "Go", not "GO" or "go". Data from APIs can be picky.
Comments 4
Join the discussion CommentAlready have an account? Log in
Collect them in a list during the same loop (formatted as "name (status)"), then after the loop join them with ", ". If the list is empty, print "none".
One loop, two outputs. Clean.
Good point, a normalise step wouldn't hurt in real code.
Comparing status — make sure it's exactly "Go", not "GO" or "go". Data from APIs can be picky.