Questions about setting up Python Dictionary!

Asked 2 years ago, Updated 2 years ago, 140 views

name = [Gayeon, Nayeon, Dayeon, ...., Hayeon]
test1 = [20, 98, ..., 86]
test2 = [50,  39, ...,39]

and

How do I set the name to key and test1, test2 to value in the function info??
I want to bundle the values in the same index and print them out!

For example,
{Positive: [20, 50], Nayeon: [98, 39],...} Like this,,

python dictionary list index

2022-09-20 22:25

1 Answers

dict(zip(name, zip(test1, test2)))


2022-09-20 22:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.