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
2. Sanjay thinks it's okay to plagiarize because he thinks his instructors won't find out. However, it's
Tatiana [17]
The correct answer is B
8 0
3 years ago
When Cloud Consumers are automatically redirected to the new cloud storage device?
Taya2010 [7]

Answer:

Cloud architecture are basically depend upon the storage replication system and it keeps synchronize the primary cloud data in the duplication storage.

And the redundant data is used when the logical unit number are migrated from one place to another. Then, it creates a copy of logical unit number.

Whenever, the primary device fail the storage path diverts the request of cloud user in secondary logical unit number and it automatically redirect to new cloud device storage.

6 0
4 years ago
6.3.6: Adding to a Value codehs<br> help i don't know what to do .
QveST [7]

Question:

Write a function that adds together all values from 0 to a given value and returns the final number. For example, if the given value is `4`, you would add 0 + 1 + 2 + 3 + 4

Answer:

In Python:

def add_to_value(n):

   sum = 0

   for i in range(n+1):

       sum = sum + i

   

   return sum

Explanation:

This line defines the function

def add_to_value(n):

This line initializes sum to 0

   sum = 0

The following iteration adds from 0 to n

<em>    for i in range(n+1):</em>

<em>        sum = sum + i</em>

   

This line returns the calculated sum

   return sum

4 0
3 years ago
1. PLCs were originally designed as replacements for: a) microcomputers. c) analog controllers. b) relay control panels. d) digi
timama [110]

Answer:

PLCs (Programmable logic controller) were original designed as replacement for relay control panels.  Relay is another word for a switch. Relay control panels were made for the control of electronic instrumentents or devices. Later on PLCs were made to replace these timers and relay control panels. PLCs are more reliable, flexible and can work better in the harsh environmental situations then the relay control panels.

3 0
3 years ago
To select both a field label and field value to move in a report design, after selecting the field label press the ____ key to s
marishachu [46]

Answer: Shift Key

Explanation: Field label is the components that used for the displaying of the  screen area and field values generate due to default. When these both are to be selected and moved in certain report design then the selection in made by first by selecting the field label and then alternately pressing the shift key to select the default field value. Thus, the field value and field label is moved into the report design.

8 0
3 years ago
Other questions:
  • Ingrid started speaking about her slide presentation. When she clicked to th
    11·2 answers
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual. wh
    5·2 answers
  • Melissa and Sue want to distribute a document to be discussed at a meeting starting in about thirty minutes. People will be atte
    14·1 answer
  • Create a DisplayBox application that prompts the user for a height and width and then displays a box of that size. The DisplayBo
    8·1 answer
  • What is the efficiency (Big O Notation) of quicksort algorithm?
    15·1 answer
  • To complete this quest, answer the following questions in the submission box below. Make x an array going from 0 to 100 by steps
    15·1 answer
  • 1. ___________ ensures the integrity and security of data that are passing over a network.
    13·1 answer
  • Imagine that a crime has been committed and being a police officer you have to investigate the case. Solving a crime can be a ve
    12·1 answer
  • What is the size of 5th generation of computer and what language does they use??​
    12·2 answers
  • What is the IT professional testing?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!