Nov-17-2020, 03:12 PM
Hey Everyone,
I just started with python so i have a little beginner problem here.
I found out that my funcion wont append the dictionary to the list. but i dont understand why.
I guess for everyone who knows python a bit better than me, the problem is simple and obvious.
So if anyone could help me, i would be really happy.
I just started with python so i have a little beginner problem here.
I found out that my funcion wont append the dictionary to the list. but i dont understand why.
I guess for everyone who knows python a bit better than me, the problem is simple and obvious.
So if anyone could help me, i would be really happy.
alben = [] def make_album (artist_name, album_title): """returns album data""" album = {'artist name: ': artist_name.title() , 'album title: ': album_title.title()} return album alben.append(album) a_album = make_album ( 'tool','salival') b_album = make_album ('selektivton','in the woods') c_album = make_album ('john frusciante','the empyrean') for i in alben: print(i)
Output:[Finished in 0.1s]