Python Forum
How to avoid "None"s in the output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to avoid "None"s in the output
#2
You get None printed because FirstClass.display function does not return anything so it does return the default None.
In your code you print from within the function, so there is no need to print again when calling the function, e.g.
replace print(x.display()) with just x.display()
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
How to avoid "None"s in the output - by sylas - Jun-06-2018, 12:18 PM
RE: How to avoid "None"s in the output - by buran - Jun-06-2018, 12:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Avoid output buffering when redirecting large data (40KB) to another process Ramphic 3 3,443 Mar-10-2018, 04:49 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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