1

Im relatively new to Python and have been trying to make a program where you can input multiple lines of integers for the program to process and return. However, my problem is that during Input, you can only type 1 line of integers. Im not looking to solve this problem through text files, but rather by user typing in multiple lines in 1 input. Anyone can guide me through this?

I have tried inserting /n when typing in the input, but it does not read it for some reason.

test_cases = input('How many test cases for the program?') x = input("Type each test case values in a separate line")

Sample Input 3 12 0 41 0 22 2 3 2 44

Output 36 0 123 0 66 6 6 4 132

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
ninja6714
  • 11
  • 1

0 Answers0