Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"None" in array
#2
This is because
    for i in shapes:
        print(i.draw())
the print here is printing the result of the method draw and as there is no return value it defaults to None
remove the print and it will no longer print None.
    for i in shapes:
        i.draw()
Reply


Messages In This Thread
"None" in array - by dl0banter - Mar-28-2019, 08:59 PM
RE: "None" in array - by Yoriz - Mar-28-2019, 09:18 PM

Forum Jump:

User Panel Messages

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