Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using class
#10
(Dec-20-2019, 01:53 PM)Carloggy Wrote: Would you share me your ideas pls?

(Dec-20-2019, 01:30 PM)ichabod801 Wrote: the way I would do it is to have two parameters for Rocket.__init__: name and height. Then before the loop where you create the rocket instances, set a variable named height to 10. Then each time through the loop you: create an instance, passing the name and the height variable as arguments, and you increase the height variable by 10.
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
using class - by Carloggy - Dec-20-2019, 10:52 AM
RE: using class - by buran - Dec-20-2019, 11:01 AM
RE: using class - by Carloggy - Dec-20-2019, 11:07 AM
RE: using class - by buran - Dec-20-2019, 11:13 AM
RE: using class - by Carloggy - Dec-20-2019, 11:14 AM
RE: using class - by buran - Dec-20-2019, 11:15 AM
RE: using class - by Carloggy - Dec-20-2019, 11:20 AM
RE: using class - by ichabod801 - Dec-20-2019, 01:30 PM
RE: using class - by Carloggy - Dec-20-2019, 01:53 PM
RE: using class - by buran - Dec-20-2019, 01:55 PM
RE: using class - by Carloggy - Dec-20-2019, 02:05 PM
RE: using class - by ichabod801 - Dec-20-2019, 03:44 PM

Forum Jump:

User Panel Messages

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