Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'NoneType' error
#3
Also, note that print() returns None
so a line like this
dollars = print(float(d.lstrip("$")))
will assign None to name dollars and even if you return dollars you still have a problem.

Check also What is the purpose of the return statement? How is it different from printing?
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
'NoneType' error - by YL1985 - Nov-24-2022, 02:14 AM
RE: 'NoneType' error - by deanhystad - Nov-24-2022, 04:08 AM
RE: 'NoneType' error - by buran - Nov-24-2022, 09:30 AM
RE: 'NoneType' error - by YL1985 - Nov-24-2022, 11:40 PM
RE: 'NoneType' error - by rob101 - Nov-24-2022, 10:23 AM
RE: 'NoneType' error - by deanhystad - Nov-24-2022, 06:25 PM
RE: 'NoneType' error - by ndc85430 - Nov-25-2022, 06:34 AM
RE: 'NoneType' error - by YL1985 - Nov-26-2022, 06:50 PM
RE: 'NoneType' error - by rob101 - Nov-25-2022, 06:56 AM
RE: 'NoneType' error - by Yoriz - Nov-26-2022, 08:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting 'NoneType' object has no attribute 'find' error when WebScraping with BS Franky77 2 5,380 Aug-17-2021, 05:24 PM
Last Post: Franky77
  Type error: '>' not supported between instances of 'NoneType' and 'int' spalisetty06 1 10,541 Apr-29-2020, 06:41 AM
Last Post: buran
  Error TypeError: '<=' not supported between instances of 'int' and 'NoneType' kaledhananjay 1 21,627 May-10-2018, 06:39 AM
Last Post: j.crater
  'NoneType' object has no attribute error, when using Kivy Screens chelovek 3 11,172 Feb-05-2017, 05:37 AM
Last Post: chelovek
  Regex error: 'NoneType' object has no attribute 'group' DBS 8 26,512 Oct-31-2016, 06:36 PM
Last Post: DBS

Forum Jump:

User Panel Messages

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