0

I'm getting a syntax error when I run this:

class Stats:
    Str = random.randint(3,18)
    Int = random.randint(3,18)
    Wis = random.randint(3,18)
    Char = random.randint(3,18)
    Con = random.randint(3,18)
    print "Type the name of a stat (Str, Int, Wis, Char or Con) to see its value"

It says that the 'closing' quote is a syntax error- since when are strings syntax errors?

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
user1987349
  • 105
  • 1
  • 1
  • 2

1 Answers1

3

Are you using python 3+? print is a function in python 3.

class Stats:
    Str = random.randint(3,18)
    Int = random.randint(3,18)
    Wis = random.randint(3,18)
    Char = random.randint(3,18)
    Con = random.randint(3,18)
    print("Type the name of a stat (Str, Int, Wis, Char or Con) to see its value")
Pavel Anossov
  • 60,842
  • 14
  • 151
  • 124