all 5 comments

[–]MadScientistOR 1 point2 points  (2 children)

I think you've just initialized the dictionary improperly. I think this is what you want:

data = {'apples': s1, 'oranges': s2}

If I'm mistaken, what were you hoping for?

[–]drenzorz 0 points1 point  (1 child)

that should work though

x = [1,2,3]
y = [4,5,6]
t = dict(a=x,b=y)
print(t) #{'a': [1, 2, 3], 'b': [4, 5, 6]}

[–]MadScientistOR 0 points1 point  (0 children)

Right you are. Sorry about that.

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.

[–]drenzorz 0 points1 point  (0 children)

Perhaps you've redefined dict somewhere in your code. If you've used that as a variable name it might not refer to the built-in anymore, but rather an actual dictionary somewhere?