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
Constraints are a. quantities to be minimized in a linear programming model. b. quantities to be maximized in a linear programmi
svetoff [14.1K]

Answer: D

Explanation:

Constraints are associations between multiple variables which set boundaries for the values these variables can take at the same time. They put limit on values that variables can accommodate.

4 0
3 years ago
TECHNICAL TERMS: the adderess of a website
riadik2000 [5.3K]
Yes very interesting
6 0
2 years ago
In cell B20, enter a
zzz [600]

Answer:

かあなたは棚田やヌタほたややあはあやあやあさあ与田弥太は沙汰やあはあわあね、田やホワアラハやくださいヤアカやさ矢田かほあや体は白湯のやさた

Explanation:

なたさたらなやさゆなやさら

5 0
1 year ago
Which of the following are benefits of designing a scalable system? Choose 3 options.
Svetllana [295]

Explanation:

ability to maintain a high level of service for costumers

users may never know when a sight has experienced tremendous growth

ability to respond to users volume issues more quickly

4 0
3 years ago
Given that n refers to a positive int use a while loop to compute the sum of the cubes of the first n counting numbers, and asso
dybincka [34]

Answer:

The program in Python is as follows:

n = int(input("n:"))

total = 0

for k in range(1,n+1):

   total+=k**3

print(total)

Explanation:

This gets input for n

n = int(input("n:"))

This initializes total to 0

total = 0

This iterates from 1 to n

for k in range(1,n+1):

This adds up the cube of each digit

   total+=k**3

This prints the calculated total

print(total)

7 0
2 years ago
Other questions:
  • How can you tell if a website is secure
    13·1 answer
  • Juliet is trying to increase her savings account and she decides that she is going save an additional $700 every month. If her m
    9·1 answer
  • An automated service that consolidates and distributes information from newsgroups, blogs, forums and news websites is called
    11·1 answer
  • What percentage of business are using social media today
    14·1 answer
  • How do the companies gather data to determine common passwords?
    13·1 answer
  • When a hoverboard's battery dies, does the hoverboard battery life get impacted the next time the battery is full?
    12·1 answer
  • Explain why it is important to follow a course or a program in keeping with your value system​
    13·1 answer
  • What does the revolver do computer science​
    9·1 answer
  • Select three advantages to using digital video.
    5·2 answers
  • To determine what to study one Should first
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!