Python Forum
declaring a new dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
declaring a new dictionary
#1
The question: How would we declare a new dictionary named myDict with one key-value pair where the key is "one" with a value of the integer of 1? You can either use single or double quotes, but ensure there are no spaces in your answer.

My solution:
myDict={"one":"1"}
This input is wrong and I am not sure why.
Reply


Messages In This Thread
declaring a new dictionary - by dedagent0900 - Feb-03-2024, 02:10 PM
RE: declaring a new dictionary - by dedagent0900 - Feb-03-2024, 02:15 PM
RE: declaring a new dictionary - by rob101 - Feb-03-2024, 03:05 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020