![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: name error
Wow. Clearly the OP does not understand indentation.
If you indent the_ship (line 13), you are trying to assign an instance of the class before it's even defined. Furthermore, indenting those last 12 lines is just silly. Now why would you want to do that? I'm assuming you're just copying someone else's code and trying to modify it? Or following some advanced game making tutorial? These are the problems that stem from being unable to code in a language you want to use for more advanced purposes... Edit: I don't like where this thread's heading, so I'll just give you the code how it should look (assuming your lines are merely incorrectly placed ... the rest is up to you): python Syntax (Toggle Plain Text)
Last edited by Sane; Dec 8th, 2007 at 11:51 AM. |
|
|
|
|
|
#12 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
Re: name error
To give a little more detail, when you indent something in Python, you're saying it belongs to a block.
python Syntax (Toggle Plain Text)
What you can't do is to alternate indentation: python Syntax (Toggle Plain Text)
But you can do this: python Syntax (Toggle Plain Text)
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic Socket Programming Error in Linux.. Pls help | boraciner | C++ | 18 | Sep 12th, 2007 1:17 AM |
| C# corruption!!! | Kilo | C++ | 32 | May 21st, 2006 8:44 PM |
| Masm | rsnd | Assembly | 4 | May 20th, 2006 9:05 PM |
| libraries | matko | C | 1 | Jan 22nd, 2006 2:12 PM |
| String error in if statement | Blighttdm | C | 12 | Nov 18th, 2005 6:34 PM |