Do you also have to define the class attributes?
class Administrator():
name = ""
os = ""
def Skills(name,os):
name = raw_input('What is your name')
os = raw_input('What is your os')
self.name = name
self.os = os
Skills(name,os)
On Sat, Jan 15, 2011 at 11:10 AM, Brett Murch <[email protected]> wrote:
> Hi everyone,
>
> I'm just starting to learn Python and am starting by creating a text
> game but am having trouble with classes and funtions. I want to create a
> class or function where someone creates a charater and has a choice of
> their name or os. This is what I have so far;
>
> class Administrator():
> def Skills(name,os):
> name = raw_input('What is your name')
> os = raw_input('What is your os')
> self.name = name
> self.os = os
>
> Skills(name,os)
>
> I keep getting a syntax error on calling it. any ideas on what I'm doing
> wrong? Should it not be a class and should I just define it as a
> function or what?
>
> Thank you in advance
>
> _______________________________________________
> Tutor maillist - [email protected]
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor