Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

1. Which of the following is the correct output for the code given below?

import numpy as np

old = np.array([[1, 1, 1], [1, 1, 1]])
new = old
new[0, :2] = 0
print(old)

A. [[1 1 1 ] [ 1 1 1]]
B. [[0 0 1] [ 1 1 1]]
C. [[0 1 1] [ 0 1 1]]
D.[[1 1 0] [ 1 1 0]]

2.

import re
s = 'ACBCAC'

For the given string, which of the following regular expressions can be used to check if the string starts with 'AC'?

A. re.findall('[^A]C', s)
B. re.findall('^[AC]', s)
C. re.findall('^AC', s)
D.re.findall('AC', s)
Consider the following variables in Python:

a1 = np.random.rand(4)
a2 = np.random.rand(4, 1)
a3 = np.array([[1, 2, 3, 4]])
a4 = np.arange(1, 4, 1)
a5 = np.linspace(1 ,4, 4)

Which of the following statements regarding these variables is correct?

A. a3.shape == a4.shape
B. a4.ndim() == 1
C. a5.shape == a1.shape
D. a1.shape == a2.shape
After having successfully completed the AI course, you get a job in another town (as an AI expert of course), and you have to move out of your apartment. You have already packed all your belongings in nine moving boxes, scattered around the apartment, now all you have left to do is to move these boxes into the moving truck, which is parked just outside of the apartment. The boxes are too big to carry, so you have to push them between the rooms. The following graph shows the four rooms in the apartment, the truck, how many boxes are initially in which rooms, and how the rooms are connected:

On each turn, you can either move or push a box into an adjacent location, in any direction: north, south, east, west. When this story begins, you have just parked the truck.
Implement the given scenario & Formulate this problem as a search problem, i.e.:
• Design suitable representation of the search states?
• Design a method of initial state
• Set goal state
• Calculate path cost at each step.
Write the pseudocode for a program that will continue prompting a user for a value whilst the total of all values remain less than 100. The program must keep track of the number of times the loop executes and display the number of times the loop executed once the loop had finished executing.
Write the pseudocode for an application that will:
a. Prompt a user for three numbers.
b. Store the values entered by a user in an array as they are provided by
the user.
c. Ask a user if they would like to search for a value:
i. If the user wishes to search for a value, the user needs to be
prompted for a value to search for. If the value is found, a
notification needs to be provided to the user.
d. Use a for loop to cycle through the arrays in order to calculate and
display the total of the values stored in the array
Write the pseudocode for an application that will:
a. Prompt a user for three numbers.
b. Store the values entered by a user in an array as they are provided by
the user.
c. Ask a user if they would like to search for a value:
i. If the user wishes to search for a value, the user needs to be
prompted for a value to search for. If the value is found, a
notification needs to be provided to the user.
d. Use a for loop to cycle through the arrays in order to calculate and
display the total of the values stored in the array.
After having successfully completed the AI course, you get a job in another town (as an AI expert of course), and you have to move out of your apartment. You have already packed all your belongings in nine moving boxes, scattered around the apartment, now all you have left to do is to move these boxes into the moving truck, which is parked just outside of the apartment. The boxes are too big to carry, so you have to push them between the rooms. The following graph shows the four rooms in the apartment, the truck, how many boxes are initially in which rooms, and how the rooms are connected:

On each turn, you can either move or push a box into an adjacent location, in any direction: north, south, east, west. When this story begins, you have just parked the truck.
Implement the given scenario & Formulate this problem as a search problem, i.e.:
• Design suitable representation of the search states?
• Design a method of initial state
• Set goal state
• Calculate path cost at each step.
Write a boolean function that returns False if the name has more than 4 letters.
Hello, I am stuck puzzle I need to complete and need help. Essentially, the puzzle is that I have 4 lightbulbs, and 3 buttons. the goal is to turn all the lights using the buttons. Here are the requirements for the question: , you need to write a correct condition of the while-loop statement so that the program
runs continuously until the goal of the puzzle is achieved. As described in the puzzle description,
the goal of the puzzle is to turn on all the lights. You need to think about what condition makes
the program run until all the lights are on.
❖ When you write the condition, you need to use the given lightList list in the program where a
state of each light (on/off) is described using Boolean data type. Each light corresponds to each slot of lightList. For example, if the 1st light is on, lightList[0] has True, and if the
2nd light is off, lightList[1] has False.
I would greatly appreciate your help!
“To help students determine whether they qualify for a supplementary exam, students can enter
their final module mark and exam mark on a webpage. If the student obtained more than 30% for
their exam mark and a final mark of less than 50%, the student will be informed that he/she
qualifies for a supplementary exam.”
Q.3.1 Write the pseudocode that will prompt a user for the required information and
accurately represent the logic contained in the scenario provided at the
beginning of the question.
LATEST TUTORIALS
APPROVED BY CLIENTS