#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    Making a game in python


    I am trying to make a game in python by watching youtube tutorials but I keep getting an error.



    Here is the error
    File "C:\Users\Johnathan\Desktop\My Game\character\character.py", line 8
    print c.name
    ^
    SyntaxError: invalid syntax
    [Finished in 0.2s with exit code 1]



    And here is my code

    class Character:
    def __init__(self, name, hp):
    self.name = name
    self.hp = hp

    c = Character("Test", 5)
    print c.name
    print c.hp

    I am using sublime text 2
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    1
    Rep Power
    0

IMN logo majestic logo threadwatch logo seochat tools logo