Answer:
class MarblesBoard(object):
def __init__(self, seq):
self.seq = list(seq)
def switch(self):
temp = self.seq[0]
self.seq[0] = self.seq[1]
self.seq[1] = temp
def rotate(self):
temp = self.seq[0]
for i in range(1, len(self.seq)):
self.seq[i-1] = self.seq[i]
self.seq[-1] = temp
def is_solved(self):
for i in range(len(self.seq)):
if i != self.seq[i]:
return False
return True
def __str__(self):
return ' '.join(list(map(str,self.seq)))
def __repr__(self):
return ' '.join(list(map(str,self.seq)))
class Solver(object):
def __init__(self, board):
self.board = board
def solve(self):
steps = 0
while not self.board.is_solved():
if self.board.seq[0] > self.board.seq[1] and self.board.seq[0] != len(self.board.seq) - 1:
self.board.switch()
else:
self.board.rotate()
print(self.board)
steps += 1
print('Total steps:', steps)
Explanation:
The Python class MarblesBoard creates an object of the board game used in the Solver class object instance and it holds data or attributes of the player piece movement and the magic methods (__str__ and __repr__). The Solver object gets the switch and rotate movementt of the player and displays the total steps at the end of the game.
Options: True or false
Answer: True
Explanation:TCP(TRANSMISSION CONTROL PROTOCOL) is is an internet control protocol that allows Communication between internet users or computers by collecting and compiling packets of data and then sending such collected packets of data to the desired user.
Before using a TCP one must first create a connection which will enable it to effectively communicate with the other user.
TCP are established using sequence numbers which can be predicted by another party for their own personal gain.
The type of manager that services all requests for data is known as IT service management (ITSM)
Answer: c) Mass media.
Explanation:
Mass media is the technological media platform which imparts information in different forms to the public and audience.It reaches audience through devices and content that can be in written format, spoken,broadcasting etc.
- Sources of mass media to impart information can be television, internet, radio, newspaper , magazine etc.
- Other options are incorrect because high-tech politics is political field with impact of technology.World Wide Web(www) is constituted of resource and internet facility.
- Government's fourth branch is the unofficial cluster of institution impacting three official branches.Media conglomeration is the firm that on various mass media companies.
- Thus, the correct option is option(c).
Creating a model provides a practical solution for some scientific research by showing systems that are very large,small,or complex.Models are simplified representations of real objects or systems.Models can make things easier to study by zooming in on a single piece of a large system or magnifying something that is too tiny to see with the naked eye.