yoba = [(None, None), (None, 'Smack my Bitch Up'), ('The Prodigy', None), ('The Prodigy', 'Smack my Bitch Up')]
def xstr(s):
return '' if s is None else str(s)
def dologic(A, B):
if (A and not B) or (not A and B):
return xstr(A) + xstr(B)
elif (A and B):
return str(A) + ' - ' + str(B)
else:
return '...'
for A, B in yoba:
print(dologic(A, B))
eW9iYSA9IFsoTm9uZSwgTm9uZSksIChOb25lLCAnU21hY2sgbXkgQml0Y2ggVXAnKSwgKCdUaGUgUHJvZGlneScsIE5vbmUpLCAoJ1RoZSBQcm9kaWd5JywgJ1NtYWNrIG15IEJpdGNoIFVwJyldCgpkZWYgeHN0cihzKToKICAgIHJldHVybiAnJyBpZiBzIGlzIE5vbmUgZWxzZSBzdHIocykKCmRlZiBkb2xvZ2ljKEEsIEIpOgogICAgaWYgKEEgYW5kIG5vdCBCKSBvciAobm90IEEgYW5kIEIpOgogICAgICAgIHJldHVybiB4c3RyKEEpICsgeHN0cihCKQogICAgZWxpZiAoQSBhbmQgQik6CiAgICAgICAgcmV0dXJuIHN0cihBKSArICcgLSAnICsgc3RyKEIpCiAgICBlbHNlOgogICAgICAgIHJldHVybiAnLi4uJwogICAgICAgIApmb3IgQSwgQiBpbiB5b2JhOgogICAgcHJpbnQoZG9sb2dpYyhBLCBCKSk=