Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (Choose two.) (assume that no other items have been created before)
A.
dir={'Mom': 5551234567, 'Dad': 5557654321}
B.
dir= {'Mom': '5551234567', 'Dad': '5557654321'}
"NameError: name 'Mom' is not defined " will happen as it will as it it will think Mom is a variable that is undefined since it is not in '' or "" like string should be
A lot of correct answers in the comments are wrong in one thing - a dictionary key does not have to be quoted, unless it's a string. It is an important distinction to saying "keys should be quoted" which is not the case.
Note the condition: "..no other items have been created before." Without enclosing Mom and Dad inside quotes(to make then string literals), they remain undefined variables.
Correct answers are A and B. Since the keys in a dictionary should be in quotes, so C and D are incorrect. The values in a dictionary may or may not be under quotes, so A and B are correct.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
technoguy
Highly Voted 2 years, 5 months ago25Topaz
Most Recent 4 months, 1 week agoJeffriXu
5 months, 3 weeks agoValcon_doo_NoviSad
6 months, 2 weeks agoAcid_Scorpion
7 months agoSadaiyan
11 months, 3 weeks agodicksonpwc
1 year agoNorbiox
1 year, 4 months agoValcon_doo_NoviSad
6 months, 2 weeks agojaimebb
1 year, 5 months agoHanjito
1 year, 7 months agoN9
1 year, 7 months agoJnanada
1 year, 8 months agoPremJaguar
1 year, 9 months agoVan_Rossum
1 year, 9 months agoSuvabrata
1 year, 10 months agomacxsz
1 year, 11 months agorocky48
2 years ago