I have to make a function to transform example 1 into example 2. I have already made a function for example 1. How do I make a function for example 2, with nested readout and with their sizes in brackets and with newlines?

example 1.

```
{
       'delo' : {
          'navodila.docx' : 83273,
          'poročilo.pdf' : 37653347,
        },
       'igre' : {},
       'seznam.txt' : 7632,
       'razno' : {
          'slika.jpg' : 4275,
          'prijatelji' : {
             'janez.jpg' : 8734765,
   }

```

example 2.

```
delo 
   navodila.docx (83273)
   poročilo.pdf (37653347)
   artikli.dat (253)
igre
seznam.txt (7632)
razno
   slika.jpg (4275)
   prijatelji
      janez.jpg (8734765)

```

My function I've made already for the first example, except without newlines:

```
import os

def f(folder):
    dict={}
    list = os.listdir(folder)
    for ts in list:
        fullName = folder + '\\' + ts

        if os.path.isfile(fullName):
            size=os.path.getsize(fullname)
            dict[ts]=size
        else:
            dict[ts]=f(fullName)
        return (dict)

```