Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Data Science by (18.4k points)

from game_state import GameState

class TippyGameState(GameState):

    def __init__(self, p, interactive=False, current_total = 0):

        GameState.__init__(self, p)

        if interactive:

                self.size = int(input('Map size?')

                self.current_total = self.size * self.size

        self.size = 3

        self.over = (current_total < 1)

When I run the above code in the terminal, it always shows a syntax error from self.current_total = self.size * self.size to the end, can someone tell me why?

1 Answer

0 votes
by (36.8k points)

Replace

self.size = int(input('Map size?')

to

self.size = int(input('Map size?'))

 Improve your knowledge in data science from scratch using Data science online courses

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...