Compress it

Report a typo

Using the pprint method, format the list of cars (this variable has been already defined) in the code below and change the width and compact properties so that your output looks like the example below:

#[['Audi A4', 'Audi A7'], ['Nissan Pathfinder', 'Nissan Rogue'], ['BMW 328i', 'BMW M3'],
# ['Toyota Camry', 'Toyota Prius']]

Tip: We guess the structure should be as follows:

pprint(..., width=..., compact=...)

Sample Input 1:

Toyota Camry,Toyota Priu
Nissan Pathfinder,Nissan Rogue
BMW 328i,BMW M3
Audi A4,Audi A7

Sample Output 1:

[['Toyota Camry', 'Toyota Priu'], ['Nissan Pathfinder', 'Nissan Rogue'], ['BMW 328i', 'BMW M3'],
 ['Audi A4', 'Audi A7']]
Write a program in Python 3





___

Create a free account to access the full topic