0
What is the output of the dict={1:'dict',2:'B',3:'C'} for i,j in dict.items(): print(i,j,end=' ')
Pls tell the output
7 Respostas
+ 6
Rajini Srinivasan ,
Is there something stopping you from running it in the playground?
+ 5
Rajini Srinivasan ,
since you have not started learning from a *sololearn python tutorial* (you signed in to sololearn at the same time the question was posted), it looks like your question is from a homework or something like this.
this is how it works roughly:
> the dictionary has 3 items
> a loop is running for each item
> each item is splitted to individual variables
> the variables with the keys / values are printed
+ 2
Rajini Srinivasan,
As mentioned by Rain try to run the code in playground first and if you face any problems then you can use the forum.
https://www.sololearn.com/discuss/1316935/?ref=app
+ 2
Rajini Srinivasan ,
Since Lothar pointed out you're brand new to Sololearn, let me give you the path to the part of the interface where you can write and run your own code.
Back out of the Q&A Discussions area and any other areas in your history until you can see the Create button.
Hit Create.
Change the dropdown menu from "Hot Today" to "My Code Bits". (It won't list any files yet, but it will later.)
Hit the round button with the + sign on it (meaning new file).
Choose Python.
Paste your code into the editor. (Edit it so the statements are on separate lines with proper indentation, since your paste above looks smashed together.)
Hit Run to see the output or any errors. Keep editing until you're satisfied
In the three-dots menu, choose Save, and name it. Leave it set to the default, "Private". (You can change it to "Public" later if you need others to see it.)
When you exit the editor, since the dropdown is on "My Code Bits", you'll see the file you just saved listed there.
+ 1
Shantanu Kanojia ,
but without commas (and assuming proper code indentation)
1 dict 2 B 3 C
+ 1
Rain ,
Yeah right ✅️
0
1 dict 2 B 3 C