I have an input that is a list of strings, and I’m not sure how to print every string in the list side-by-side, and add hyphens underneath each string.
Example input: [‘13 + 11’, ‘12 - 4’, ‘36 + 18’]
Desired output:
13 12 36
+ 11 - 4 + 18
______ ___ ____
What I’ve tried:
I Tried using a for-in loop to loop over the strings in the input list, and splitting them up on a space:
for i in problems:
j = i.split(’ ')
print(j)
I’m lost as to how to go about printing the strings side-by-side. I have a feeling it’s something to do with including a newline character, but beyond that I’m having trouble. If anyone can recommend an approach, as well as material to read to better understand what I’m trying to do, I would appreciate it. Thanks!