Tick all correct answers:
Say we have a dictionary numbers
Running the statement numbers["3"] = "Three"
will ...
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
No hints are availble for this assesment
Answer is not availble for this assesment
Please login to comment
25 Comments
This comment has been removed.
numbers = { }
numbers["3"] = "Three"
print(numbers)
Update the value of key "3" to "Three" if the key "3" exists
Create a key value pair of "3" and "Three" if the key "3" does not exist
Upvote ShareIncorrect answer. ????????????
Upvote ShareHi,
There are multiple correct answers to this question, are you selecting only one of them?
Thanks.
-- Rajtilak Bhattacharjee
Upvote Sharehello sir,
It's showing that the answer is incorrect I have solved this prob in jupiter also to cross verify ,then why it's showing so,Please help me in that
Thanks
can you please let me know is my answer wrong or right,
Upvote ShareThanks
Hi,
The answer that you had selected is right, but there is another answer which is right too, and you need to select that along with this one.
Thanks.
-- Rajtilak Bhattacharjee
Upvote ShareHi,
There are multiple correct answers to this question, you have marked only one of them.
Thanks.
-- Rajtilak Bhattacharjee
Upvote ShareThere is an issue with this question. I tried the 1st and the 2nd option for answer and it just says incorrect answer! Can you please fix this issue.
Upvote ShareQuestion is correct. Please select the correct answers. Also try it on the Python shell or notebook
Upvote ShareThank you, I got the right answer!
Upvote Sharei am trying to select the option 2 but it says incorrect answer :(
Upvote ShareHi, Mamta.
Are you sure 2nd only is correct answer?
As per the concept of dictionary numbers["3"] = "Three" also updates the value for key "3".
You can try it in Python shell.
All the best.
--
Upvote ShareBest,
Satyajit Das
Say we have a dictionary numbers Running the statement numbers["3"] = "Three" will ...
update the value of key "3" to "Three" if the key "3" exists
create a key value pair of "3" and "Three" if the key "3" does not exist
cause a KeyError
This question has no correct answer..
Upvote ShareHi, Rajiv.
Can you please look it again?
numbers["3"]="Three" will update the value to "Three" with key "3" exits also it will create a key value pair if key "3" does not exits.
All the best.
Upvote Sharepls check all options it is showing incorrect answer Qtn no 60
Upvote ShareHi, Rupali.
By the concept of dictionary.
mydict={}
mydict[key]=value for updating the key value.
Note :- Here "key" and "value" can be integer or string.
1) If you are using mydict["3"]="Three" then it will create a key value pair if don't exit.
2) If you do mydict["3"]="Four" the it will update the value "Three" to "Four" for key as "3".
You can try it in Python shell.
All the best.
Upvote Share-- Please reply above this line --
Hi,
By the concept of dictionary.
mydict={}
mydict[key]=value for updating the key value.
Note :- Here "key" and "value" can be integer or string.
1) If you are using mydict["3"]="Three" then it will create a key value pair if don't exit.
2) If you do mydict["3"]="Four" the it will update the value "Three" to "Four" for key as "3".
You can try it in Python shell.
All the best.
--
Upvote ShareBest,
Satyajit Das
its giving incorrect for any answer
Upvote Share-- Please reply above this line --
Hi,
By the concept of dictionary.
mydict={}
mydict[key]=value for updating the key value.
Note :- Here "key" and "value" can be integer or string.
1) If you are using mydict["3"]="Three" then it will create a key value pair if don't exit.
2) If you do mydict["3"]="Four" the it will update the value "Three" to "Four" for key as "3".
You can try it in Python shell.
--
Upvote ShareBest,
Satyajit Das
thank you
Upvote Shareincomplete question, pls check it
Upvote ShareHi, Retheesh.
By the concept of dictionary.
mydict={}
mydict[key]=value for updating the key value.
Note :- Here "key" and "value" can be integer or string.
1) If you are using mydict["3"]="Three" then it will create a key value pair if don't exit.
2) If you do mydict["3"]="Four" the it will update the value "Three" to "Four" for key as "3".
You can try it in Python shell.
All the best.
Upvote Share60 is not understandable
Upvote ShareThank you for letting us know. Please check now.
Upvote Share