+ 1

How to input two rows?

Like this: 10 2 15 7 2 3

31st Jan 2019, 7:27 AM
周志桓
周志桓 - avatar
3 Respostas
+ 5
s = '''10 2 15 7 2 3''' n = [tuple(map(int, t.split())) for t in s.split('\n')] print(n) # [(10, 2), (15, 7), (2, 3)] Is this what you mean? Or maybe this => print([tuple(i) for i in zip(*n)]) # [(10, 15, 2), (2, 7, 3)]
31st Jan 2019, 9:26 AM
Anna
Anna - avatar
0
no way!!!
31st Jan 2019, 9:12 AM
Ivan Morda
0
Thank you very much!
31st Jan 2019, 9:45 AM
周志桓
周志桓 - avatar