I have looked into the pprint function, which i tried below:
from pprint import pprint
a = [[1,2],[3,4]]
pprint(a)
But it didn’t give me what i want, which is:
1 2
3 4
Is there a simple way to solve this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can either do what Ignacio said or change the width of pprint:
But you would have to calculate the space that your list takes…