Question: write a python function that takes either lists or tuples and prints them out in a pretty way. for instance, if t1 is: t1 =
write a python function that takes either lists or tuples and prints them out in a pretty way.
for instance, if t1 is:
t1 = "apple", 3, 1.4, ("a1", "a2"), ("a1",("b1","b2",("c1","c2","c3"),"b3"),"a2") then prettyPrint(t1) prints:
apple 3 1.4 a1 a2 a1 b1 b2 c1 c2 c3 b3 a2
t2 = ["apple", 3, 1.4, ["a1", "a2"], ["a1",["b1","b2",["c1","c2","c3"],"b3"],"a2"]] then prettyPrint(t2) prints:
apple 3 1.4 a1 a2 a1 b1 b2 c1 c2 c3 b3 a2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
