Can you please explain the output of this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Can you please explain the output of this code?

numbers = ["one", "two", "three", "four"] num_dict = {x[0]: x for x in numbers} print(num_dict['t']) Answer is three

16th Mar 2020, 11:14 AM
APC (Inactive for a while)
APC (Inactive for a while) - avatar
5 Answers
+ 7
All Python Challenges are welcome. "No access to a pc" is no excuse, as long as you have a mobile phone with internet connections. Many sololearn users have the same conditions as you. I also do a lot of coding on my 7 years old phone. To test and evaluate all your questions, you can use the playground or some other online editors, you have access to the python docs you can use google. So what is your motivation to post all these questions? Wouldn't it be not a good idea trying to work through all of your questions by yourself?
16th Mar 2020, 12:19 PM
Lothar
Lothar - avatar
+ 4
:) I don't know how to learn to debug and I can't access to my pc, I'm trying to learn python thorough my phone by watching videos and making challenges here. And I have started to learned like 3 months ago and originally I'm an electrical engineer. I'm forcing my capacity :) but I'm open to any help. What can I do more? Thanks for caring ~ swim ~
16th Mar 2020, 11:39 AM
APC (Inactive for a while)
APC (Inactive for a while) - avatar
+ 4
I need to learn more, practice more. I understood your answers. For some questions I find answers by myself, but to go further I need to study more. Like I said I'm beginner :(
16th Mar 2020, 1:17 PM
APC (Inactive for a while)
APC (Inactive for a while) - avatar
+ 3
Lothar and ~ swim ~ you're right, but I'm sooooo beginner. I really appreciate the debugging that ~swim~ showed me but I even couldn't understand how he did it and I was embarrassed to ask it back :(
16th Mar 2020, 1:01 PM
APC (Inactive for a while)
APC (Inactive for a while) - avatar
0
Answer is one
17th Mar 2020, 7:51 AM
naveenmajeed
naveenmajeed - avatar