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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!