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
PLEASE HELP!!!!!!!!!!!!!!!!!!
Jobisdone [24]
Step 1: Click the Start button in the bottom left-hand corner, and then click one of the library icons Documents, Pictures or Music to see any folders or files that have already been saved. Browse to find the file that you want to compress.

 

Step 2: If you wish to include two or more files and they are not already in a folder, you now need to put them into a folder. To create a new folder, right-click on the screen and scroll down to New and then to Folder. 

 

Type in the name of the folder in the space where the text is highlighted. Then simply click and drag the file(s) you want to compress into the new folder.

 

Step 3: When you are ready, right click on the file or folder that you want to compress. Select Send to from the menu which appears and select Compressed (zipped) folder from the list of options.
 

Step 4: This will create a compressed folder with the same name as your original folder and in the same location, to which your files will be copied. (Depending upon the size of your files, you might need to wait for this process to be completed. In this case a dialog box will appear to show you the progress of the compressing files.) 

 

Your compressed file is then ready for storage or to send as an email attachment.

 

Follow these step-by-step instructions on how to uncompress a file

 

Step 1: Browse to find the file you wish to uncompress.

 

Step 2: Right click on the file.

 

Step 3: Select Extract all… from the menu which appears. This will open the 'Windows Extraction Wizard'. Select Extract. Make sure that the check box is ticked for show extracted files when complete. Your folder and its contents will be available to view and to edit.

6 0
4 years ago
Convert 1 pound into newtons
Andreyy89

1 pound force = <em>4.448 newtons</em> (rounded)


8 0
4 years ago
Read 2 more answers
Which of the following subjects is considered technical education
irina1246 [14]

Hello, can you please include the subjects and i will do what i can to help you.

Thank you,

Rubin.

6 0
3 years ago
6.3 code practice: Question Edhesive
BlackZzzverrR [31]

Answer:

The source code and output is attached

I hope it will help you!

Explanation:

3 0
4 years ago
Construct pseudocode for a program that prints ‘Hello World’ on the screen.
bagirrra123 [75]

Answer:

Declare a class with name A.

Declare the main method public static void main(String args[]){

Now Type the System. out. println("Hello World"); which displays the text Hello World.

Explanation:

google

7 0
3 years ago
Read 2 more answers
Other questions:
  • You are a cleared employee. You discovered fraud and waste of money related to a classified program within your agency. If you r
    9·1 answer
  • A is the smallest unit of application data recognized bysystem software.
    12·1 answer
  • Give an example of an expression that has three terms. The first term should have two factors, the second term should have three
    14·1 answer
  • There are three main components to economic growth. Which of the following is NOT a component of economic growth?
    7·1 answer
  • A file ____ utility is a utility that shrinks the size of a file(s).
    6·1 answer
  • Hlo plss help.<br>.....,, ​
    7·2 answers
  • When adopting and implementing a Software as a Service (SaaS) platform such as Salesforce for your business, which responsibilit
    7·1 answer
  • U $ er Ideas for R 0 B 1 0 X?
    12·2 answers
  • What is meant by normalization? Occurs when an intrusion detection system labels normal activity as anomalous. The process of tr
    5·1 answer
  • How did people figure qwerty keyboard set up, instead of the abcdef setup?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!