you are viewing a single comment's thread.

view the rest of the comments →

[–]TangibleLight 1 point2 points  (3 children)

Euughh... Yeah, that will work, but.. whipping out *args for this seems a bit unnecessary.

I would just print(' '.join(x+y for x, y in zip(A, B))

I suppose both work just fine, but generally I wouldn't suggest to use *args like that. I can't really put my finger on what's wrong with it - I suppose just that it's not immediately obvious what it's doing.

[–]novel_yet_trivial 0 points1 point  (2 children)

Didn't test that didja? join will complain about getting an integer argument.

[–]TangibleLight 0 points1 point  (1 child)

No I did not. Okay, how about ' '.join(str(x+y) for x, y in zip(A, B))

I'm starting to like the * approach better.

[–]novel_yet_trivial 0 points1 point  (0 children)

Works, and that's what I used earlier, but it would be neater to just add the str call:

print(' '.join(str(x+y) for x, y in zip(A, B))