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
Computer models are the only type of model that can be used to make predictions. Please select the best answer from the choices
katrin2010 [14]
<span>Computer models are the only type of model that can be used to make predictions.
This is a false statement.

</span>
8 0
3 years ago
Read 2 more answers
You have a friend that says she is interested in going into web development. She is very knowledgeable in terms of technology an
Schach [20]

Answer:

She should be aware several social media spectators are going to watch her content. She will get exposed on the Internet.

Explanation:

She should be aware several social media spectators are going to watch her content. She will get exposed on the Internet.

She should think before saying anything as one of his fans may complaint about her content to the police if she makes a joke about shooting up a place.

She has to be careful with his words as this may lead to termination from the job.

4 0
3 years ago
Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
jek_recluse [69]

Answer:

oneMore(oneMore(oneMore(oneMore(oneMore(0)))))

Explanation:

  • As a function has been explained which when given an integer results as a next integer. oneMore(given-integer)= next integer
  • As we are restricted to use 0 only and can't use operators like + - * /.
  • We have to obtain a value 5
  • So doing step-by-step:

             (oneMore(0))=1

             (oneMore(oneMore(0)))=2

             (oneMore(oneMore(oneMore(0))))=3

             (oneMore(oneMore(oneMore(oneMore(0)))))=4

             oneMore(oneMore(oneMore(oneMore(oneMore(0)))))=5

7 0
3 years ago
Which query will return the entire Gamers table?
Serga [27]

SQL queries can be used to retrieve data from a table.

The query that returns the entire Gamers table is (b) SELECT * FROM Gamers;

To retrieve a data we make use of the SELECT FROM clause

From the question, we understand that all entries of the Gamers table should be returned.

The keyword ALL in SQL is represented with asterisk i.e. *

The table whose data would be retrieved is the Gamers table.

Hence, the required query is: SELECT * FROM Gamers;

Read more about SQL queries at:

brainly.com/question/24223730

7 0
3 years ago
Read 2 more answers
What does it mean by null in programming?
Marysya12 [62]
In computer programming<span>, </span>null<span> is both a value and a pointer. </span>Null<span> is a built-in constant that has a value of zero. It is the same as the character \0 used to terminate strings in C. </span>Null<span> can also be the value of a pointer, which is the same as zero unless the CPU supports a special bit pattern for a </span>null<span> pointer.</span>
8 0
3 years ago
Other questions:
  • Which three of the following are requirements for receiving federal financial aid for college education?
    14·2 answers
  • All phones must have a way of making and then terminating a connection to the phone network; however the exact procedure for doi
    6·1 answer
  • How do say phone in French?
    10·2 answers
  • Select the strategies below that are likely to increase audience attention.
    14·2 answers
  • List the various types of social media that have been covered in the tutorial. Mention the key purposes for which each media typ
    9·1 answer
  • A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support m
    10·1 answer
  • Which piston stroke of the four-stroke cycle prepares the fuel mixture for combustion??
    8·1 answer
  • When you cut and then paste a file, what are you doing?
    7·2 answers
  • Whers the main characteristic of a Peer-to-peer (P2P) network?
    14·1 answer
  • You work for a retail clothing chain whose primary outlets are in shopping malls and are conducting an analysis of your customer
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!