Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dictionary Basics
#2
Here's the thing: Your holiday dict is set up to store ONE holiday. So you either need a list of similar dicts, or a dict of similar dicts. If you want to look up an input date, then you should have a dict of dicts, with the key being the date. That is basically what your for loop is doing, but that's not how you initialize it. Try running your code but start with a blank dictionary on line 3.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Dictionary Basics - by pythonjm - Nov-26-2018, 02:12 PM
RE: Dictionary Basics - by ichabod801 - Nov-26-2018, 05:37 PM
RE: Dictionary Basics - by pythonjm - Nov-26-2018, 08:26 PM
RE: Dictionary Basics - by ichabod801 - Nov-26-2018, 08:34 PM
RE: Dictionary Basics - by Gribouillis - Nov-26-2018, 09:56 PM
RE: Dictionary Basics - by pythonjm - Nov-26-2018, 11:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Learned Python Basics, what now? muzikman 20 6,257 Oct-11-2021, 01:34 AM
Last Post: Underscore
  PYserial basics? bako 10 5,194 Apr-26-2020, 09:15 PM
Last Post: bowlofred
  [split] Debugging scripts basics tultalk 5 3,145 Apr-25-2020, 01:02 AM
Last Post: menator01
  Debugging scripts basics bako 8 3,593 Apr-24-2020, 06:18 AM
Last Post: Larz60+
  Problem with basics Wraith2102 2 2,028 Jun-17-2019, 06:51 PM
Last Post: perfringo
  What to do after learning python basics xyzabc12310000 1 2,873 May-20-2018, 11:43 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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