<div class="gmail_quote">On Sun, Oct 11, 2009 at 2:42 PM, <a href="mailto:shellcom3@juno.com">shellcom3@juno.com</a> <span dir="ltr">&lt;<a href="mailto:shellcom3@juno.com">shellcom3@juno.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I want to display the ship default value for zero and display the ship&#39;s initial fuel level. Also have a method called status that displays an object&#39;s name and  fuel values. I want to have several Ship objects and call their status() methods to test various aspects of the class constructor.<br>

</blockquote><div><br></div><div>And what problems have you run into? What would you like from us? This sounds vaguely like homework which we don&#39;t do here. We are, however, more than happy to offer pointers in the right direction if you get stuck.</div>

<div><br></div><div>For an explanation of /how/ to ask a good question, check out this: <a href="http://catb.org/~esr/faqs/smart-questions.html#examples">http://catb.org/~esr/faqs/smart-questions.html#examples</a></div><div>

<br></div><div>HTH,</div><div>Wayne</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Here&#39;s my code:<br>
<br>
                   class Ship(object):<br>
    &quot;&quot;&quot;A spaceship&quot;&quot;&quot;<br>
    total = 0<br>
    def __init__(self, name, fuel = 0):<br>
<br>
        print &quot;My spaceship has arrived! The&quot;,name<br>
        <a href="http://self.name" target="_blank">self.name</a> = name<br>
        self.fuel = fuel<br>
<br>
        print &quot;My fuel level is&quot;, fuel<br>
<br>
    def status():<br>
        Ship.total += 1<br>
        print &quot;The total number of objects is&quot;, Ship.total<br>
    status = staticmethod(status)<br>
<br>
#main<br>
ship = Ship(&quot;Galaxia&quot;)<br>
<br>
print &quot;\nCreating objects.&quot;<br>
ship1 = Ship(&quot;object 1&quot;)<br>
ship2 = Ship(&quot;object 2&quot;)<br>
ship3 = Ship(&quot;object 3&quot;)<br>
Ship.status()<br></blockquote><div><br></div><div> </div></div>