Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
__dict__ in math library
#7
when you iterate over dict, you iterate over keys only, i.e. for key in some_dict: is equivalent to for key in some_dict.keys():. You need to iterate over some_dict.items() if you want to get both key and value, i.e. you get (key, value) tuple which you unpack, in your case into a and b respectively
akbarza likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
__dict__ in math library - by akbarza - Sep-27-2023, 06:49 AM
RE: __dict__ in math library - by buran - Sep-27-2023, 07:41 AM
RE: __dict__ in math library - by akbarza - Sep-27-2023, 08:14 PM
RE: __dict__ in math library - by deanhystad - Sep-27-2023, 08:52 PM
RE: __dict__ in math library - by akbarza - Sep-28-2023, 07:09 AM
RE: __dict__ in math library - by akbarza - Sep-28-2023, 07:45 AM
RE: __dict__ in math library - by buran - Sep-28-2023, 08:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  math.log versus math.log10 stevendaprano 10 2,496 May-23-2022, 08:59 PM
Last Post: jefsummers
  Why getting ValueError : Math domain error in trig. function, math.asin() ? jahuja73 3 3,835 Feb-24-2021, 05:09 PM
Last Post: bowlofred
  dict and __dict__ cls0724 1 2,723 Apr-05-2020, 07:45 PM
Last Post: Mateusz
  what is the __dict__ object? aaron1989041 6 4,830 Mar-29-2018, 05:18 AM
Last Post: Gribouillis
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,863 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

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