I'm working on a text based game and I've done this so far:
class Map():
room1 = ('sampletext')
print(Map(room1))
but then i get an error:
Traceback (most recent call last):
File "C:/Users/Owner/Downloads/Text.py", line 3, in <module>
print(Map(room1))
NameError: name 'room1' is not defined
and I don't understand why the string from the variable isn't being printed because i am calling the class, but it says that the variable isn't recognized as a variable in the code. I want feedback so I can finish up this game.
()around'sampletext'? If you're trying to make a tuple with one element, you need a comma:('sampletext',).