Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_key():
- print("There was the face of a sphinx")
- print("riddle?")
- print("what is that which has foor feet in the morning,\n two feet in the afternoon and three feet in the evening")
- x=input()
- print("I answered:"+str(x))
- if x=="human":
- result=True
- else:
- result=False
- return result
- class Room():
- def __initi__(self, name, description, door="closed"):
- self.name=name
- self.description=description
- self.door=door
- def get_all(self):
- if self.door=="closed":
- return self.name, self.door
- elif self.door=="open":
- return self.description
- def set_all(self,nwname, nwdescription):
- has_key=False
- has_key=set_key()
- self.name=nwname
- self.description=nwdescription
- if has_key==True:
- self.door="open"
- else:
- self.door="closed"
- k=Room()
- k.set_all("kitchen", "hot,hot,hot")
- print(k.get_all())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement