Python Forum
General Programming Question with Dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General Programming Question with Dictionary
#10
(Jan-07-2022, 10:57 PM)Pedroski55 Wrote: Can you post your an excerpt from your dictionary, maybe 3 or 4 key:value pairs?

That would make things clearer for me.

Please see below:
for key, value in cybc.items():
    print('Key',key, '->', 'Value',value ,'\n')
 
Key BookNumber -> Value (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)
Key Book Names -> Value ('For Whom the Bell Tolls', 'Brave New World', 'Nineteen Eighty-Four', 'The Sound and the Fury', 'Gone with the Wind', "Lady Chatterley's Lover", 'The Hound of the Baskervilles', 'I Am Number 4', 'The Great Gatsby', 'The War of the Worlds', 'The Lord of the Rings', 'Martin Eden', 'On the Road', "A Room of One's Own", 'Lord Jim', 'Manhattan Transfer', "Sophie's Choice", 'The Catcher in the Rye', 'No Orchids For Miss Blandish', 'The Origins of Totalitarianism The Burden of Our Time', 'Fahrenheit 451')
Key Pages -> Value (None, 311, 328, 326, '1037 (first edition), 1024 (Warner Books Paperback)', None, None, 440, None, 287, 'original manuscripts, which total 9,250 pages', None, 320, 172, None, None, 562, 234, None, 704, 256)
Key Written Time/Published -> Value (1940, 1932, 1949, 1929, 1936, 1928, '1901–02', 2009, 1925, 1898, '1954–55', 1909, 1957, 1929, 1900, 1925, 1979, 1951, 1939, 1951, 1953)
Key Authors -> Value ('Ernest Hemingway', 'Aldous Huxley', 'George Orwell', 'William Faulkner', 'Margaret Mitchell', 'D.H. Lawrence', 'Arthur Conan Doyle', 'Jobie Hughes, James Frey', 'F. Scott Fitzgerald', 'H.G. Wells', 'J.R.R. Tolkien', 'Jack London', 'Jack Kerouac', 'Virginia Woolf', 'Joseph Conrad', 'John Dos Passos', 'William Styron', 'J.D. Salinger', 'James Hadley Chase', 'Hannah Arendt', 'Ray Bradbury')
Reply


Messages In This Thread
RE: General Programming Question with Dictionary - by giddyhead - Jan-07-2022, 11:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python can - general question caslor 0 1,138 Jul-14-2022, 05:21 PM
Last Post: caslor
  a general question barryjo 5 1,552 Feb-01-2022, 10:12 PM
Last Post: Gribouillis
Big Grin General programming question (input string)[ jamie_01 2 1,638 Jan-08-2022, 12:59 AM
Last Post: BashBedlam
  Question about formula implementation in general format Alienspecimen 0 1,680 Mar-01-2021, 08:39 PM
Last Post: Alienspecimen
  General list size question to solve problem Milfredo 3 2,388 Sep-27-2020, 08:42 AM
Last Post: Milfredo
  New to programming, loop question tomyan 1 1,671 Sep-25-2020, 04:32 PM
Last Post: Larz60+
  General Listbox question. Milfredo 4 2,195 Sep-06-2020, 07:36 PM
Last Post: Milfredo
  Dictionary question DrZ 2 1,684 Jul-29-2020, 08:53 PM
Last Post: DrZ
  General question about serialization/deserialization in python local 1 1,868 Jan-28-2020, 04:35 AM
Last Post: Larz60+
  General Programming Question Qui_Ten 1 2,211 Jan-14-2019, 11:15 AM
Last Post: steve_shambles

Forum Jump:

User Panel Messages

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