Python Forum
another positional argument error (...and executing objects stored in a list)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
another positional argument error (...and executing objects stored in a list)
#8
I must've misunderstood what you were telling me before, buran. I thought that testing the object type, somehow, using isCircle/isRectangle would solve my issue? I have removed it from both classes and removed the kind property, as well.

Also, I've changed
for i in shape_list:
    if i.isCircle():
        circle.draw()
    elif i.isRectangle():
        rectangle.draw()
to

for shape in shape_list:
    shape.draw()
as ichabod801 pointed out.

I also made a few minor tweaks (e.g. resetting the turtle screen each time user selects draw) and the code is now working as intended! Big Grin Yay! Thank you both for being so helpful (and thank you for explaining to me the reason for the issues with the way my code was written, too). Admittedly, I am an "older" student and worried that this (coding) might be beyond my grasp but I've found this forum (I've received assistance from both of you before) to be a major help.
Reply


Messages In This Thread
RE: another positional argument error (...and executing objects stored in a list) - by itmustbebunnies - Nov-16-2018, 07:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: __init__() missing 1 required positional argument: 'successor siki 1 4,334 Mar-08-2021, 02:05 PM
Last Post: Larz60+
  Missing 1 required positional argument in python code edwinostby 7 10,028 Jan-19-2021, 12:52 PM
Last Post: Serafim
  Missing positional arguments error?? hhydration 2 2,167 Oct-01-2020, 05:33 AM
Last Post: buran
  List of Objects print <__main. Problem Kol789 10 3,559 Jul-21-2020, 09:37 AM
Last Post: DeaD_EyE
  missing positional argument error programmert 1 2,837 Oct-18-2019, 11:05 AM
Last Post: Larz60+
  missing 1 required positional argument jedmond2 4 6,753 Sep-19-2019, 12:00 PM
Last Post: jefsummers
  missing 1 required positional argument mcgrim 10 19,866 May-07-2019, 09:02 PM
Last Post: Yoriz
  sorting a deck of cards (objects in a list) itmustbebunnies 1 7,236 Dec-05-2018, 02:44 AM
Last Post: ichabod801
  TypeError: method missing 1 positional argument koolinka 4 5,083 Nov-18-2018, 04:53 PM
Last Post: ichabod801
  Class positional argument error itmustbebunnies 2 3,027 Nov-07-2018, 11:09 AM
Last Post: stullis

Forum Jump:

User Panel Messages

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