1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
maks197457 [2]
3 years ago
15

You need to implement a class that represents the state of a room or game section. The class will contain a room_id, a descripti

on, and possibly a choice1 and a choice 2. You will need to implement the __str__ override to output the state of the room. You should also implement a method called game_over. If the room does have a choice 1 and choice2 then the game is over and it should return True.
Computers and Technology
1 answer:
qaws [65]3 years ago
4 0

Answer:

class Home(object):

   def __int__(self):

       room1()

  # room1 is the bedroom, you could either sleep or leave the room

   def room1(self):

       print("Room 1")

       choices = ['sleep', 'leave']

       for _ in iter(list, 0):

           mychoice = input("What do you want to do here sleep/leave: ")

           if mychoice == choice[0]:

               print("You are sleeping")

           elif mychoice == choice[1]:

               self. room2()

           else:

               self. game_over()

   # room2 is the living room for fun and recreation

   def room2(self):

       print("Room 2")

       choices = ['watch a movie', 'dance', 'call a friend', 'leave']

       mychoice = input("What do you want to do here: ")

       for _ in iter(list,0):

           if mychoice == choice[0]:

               print("I love this movie")

           elif mychoice == choice[1]:

               print("You are a good dancer.")

           elif mychoice == choice[2]:

               self. room1()

           else:

               self. game_over()

   # this method ends the program

   def game_over(self):

       quit()

Explanation:

The simple python object oriented program defines class with three methods room1, room2 and game_over which are all linked from the __init__ method from where the room1 is call first.

You might be interested in
Instructions:Type the correct answer in the box. Spell all words correctly.
weeeeeb [17]
The answer should be RAM = Random Access Memory

RAM memory is used to store current data while the computer is on. Bear in mind that after the computer is shutdown all data in RAM is lost.
6 0
3 years ago
Read 2 more answers
Which of the following documents cannot be created using the Microsoft® Word® application?
denis23 [38]
The correct answer is C. Customer spreadsheet
7 0
4 years ago
Read 2 more answers
________ is installed on your computer, and when the program is opened, your e-mail downloads to your computer.
kenny6666 [7]
An email client is installed, like Microsoft Outlook for example.
4 0
3 years ago
Read 2 more answers
Phoebe has to give a presentation about recycling. Where should she look while presenting?
Naddika [18.5K]
Well, I think that maybe the answer is B or C. She shouldn't only look at her presentation while she is presenting it, that doesn't look professional, and you want to look at the people you are talking to.
6 0
3 years ago
Read 2 more answers
Picture question please help me
cluponka [151]

Answer:

where is the picture?????

6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest
    10·1 answer
  • Which of the following should be the first page of a report?
    11·1 answer
  • How did voyager 1 and voyager 2 made outer space exploration and easier
    11·1 answer
  • ______ is the software that blocks a user from being able to access your computer.
    9·1 answer
  • When a client computer wants to connect to a service instance, what specific name type does it use to find the service?
    9·1 answer
  • Which slide elements must claire use to enhance her presentation?
    10·2 answers
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    11·1 answer
  • Sharl downloads images from an online library and uses them in her work. The images are shared under the Creative Commons Attrib
    13·1 answer
  • Three types of keys on the keyboard​
    15·2 answers
  • Ethics related to all <br> artificial intelligence?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!