Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using class
#11
I mean the modified code. I didn't understand the some of english terms.
Reply
#12
My idea was to change Rocket to this:

class Rocket ():
    def __init__(self, name, height):
        self.name = name
        self.height = height
So now you have to specify the height each time you make a rocket. In your loop when you create the rocket, you just need to increase that amount by 10 each time through the loop.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

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