Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Code help
#2
Tthere is error:

ERROR:root:Missing 'name'  of 'funds' key in lender: {'id': 1, 'name': 'Lender A', 'available_funds': 3000, 'min_interest_rate_%': 5, 'max_risk': 2}
There is code which causes it:

 if 'name' not in lender or 'funds' not in lender:
            logging.error(f"Missing 'name'  of 'funds' key in lender: {lender}")
There is no key 'funds' in lender:

>>> lender = {'available_funds': 7000}
>>> 'funds' in lender
False
>>> for key in lender:
...     if 'funds' in key:
...         print(key)
...
available_funds
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
[split] Code help - by emma1423 - Dec-12-2024, 12:41 PM
RE: [split] Code help - by perfringo - Dec-13-2024, 02:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] How to continue code after .show() in matplotlib? pythonnewbie62 1 361 Apr-28-2025, 04:02 PM
Last Post: deanhystad
  [split] another problem with code blakeusherremix68 0 474 Dec-23-2024, 11:36 PM
Last Post: blakeusherremix68
  [split] Explain the python code in this definition Led_Zeppelin 1 1,386 Jan-13-2023, 10:20 PM
Last Post: deanhystad
  [split] Kera Getting errors when following code example Image classification from scratch hobbyist 3 5,689 Apr-13-2021, 01:26 PM
Last Post: amirian
  [split] Python code help sairam17519 3 3,826 Sep-10-2020, 01:44 PM
Last Post: sairam17519
  How to Split Output Audio on Text to Speech Code Base12 2 8,209 Aug-29-2020, 03:23 AM
Last Post: Base12
  How to split and combine embedded lines using less code pjfarley3 6 3,940 Aug-13-2020, 09:13 PM
Last Post: pjfarley3
  [split] SyntaxError when trying to execute code on Windows nehaya 2 2,635 Aug-04-2020, 11:18 AM
Last Post: nehaya
  [split] need help with the code CERO123 2 2,580 Feb-10-2020, 03:32 PM
Last Post: jefsummers
  [split] VS Code Editor SupaNub 5 4,176 Nov-27-2019, 03:37 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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