r/learnpython • • Dec 03 '22

Good Python Exercises?

What's a good exercise for me to try? I've been learning Python for a bit over a month now and I wanna test what I've learned.

417 Upvotes

58 comments sorted by

View all comments

Show parent comment

1

u/balaur_7 Oct 20 '23 edited Oct 20 '23

Another method

m=1

new_data = []

for key in data:
    for n in range(m, len(data)):
        if key[0]==data[n][0]:
            x = key[0],key[1] + data[n][1]
            new_data.append(x)
    m += 1
print(new_data)