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
snow_tiger [21]
3 years ago
8

A certain robot can perform only 4 types of movement. It can move either up or down or left or right. These movements are repres

ented by ’U’, ’D’, ’L’, ’R’. Assume all these movements to be of unit distance. Write a function named theRoundTrip that takes all the movements the robot made in a day as input and output True of bool type if the robot returned to its starting position after its journey. Otherwise, return False. If the input is bad print the message "bad input".
Engineering
1 answer:
Olegator [25]3 years ago
8 0

Answer:

def theRoundTrip(movement):

   x=0

   y=0

   for i in movement:

       if i not in ["U","L","D","R"]:

           print("bad input")

           return

       if i=="U":

           y+=1

       if i=="L":

           x-=1

       if i=="D":

           y-=1

       if i=="R":

           x+=1

   return x==0 and y==0

You might be interested in
Cuál de las siguientes es la mejor manera de practicar sus habilidades de tecnología de secundaria?
Mkey [24]
Huh? Do you know English?
8 0
3 years ago
Five hundred gallons of 89-octane gasoline is obtained by mixing 87-octane gasoline with 92-octane gasoline. (a) Write a system
miskamm [114]

Explanation:

a) The total volume equals the sum of the volumes.

500 = x + y

The total octane amount equals the sum of the octane amounts.

89(500) = 87x + 92y

44500 = 87x + 92y

b) desmos.com/calculator/ekegkzllqx

As x increases, y decreases.

c) Use substitution or elimination to solve the system of equations.

44500 = 87x + 92(500−x)

44500 = 87x + 46000 − 92x

5x = 1500

x = 300

y = 200

The required volumes are 300 gallons of 87 gasoline and 200 gallons of 92 gasoline.

6 0
3 years ago
A non-inductive load takes a current of 15A at 125V. An inductor is then connected in series in order that the same current shal
Norma-Jean [14]

Answer:

The inductance of the inductor is 0.051H

Explanation:

From Ohm's law;

  V = IR .................. 1

The inductor has its internal resistance referred to as the inductive reactance, X_{L}, which is the resistance to the flow of current through the inductor.

From equation 1;

V = IX_{L}

X_{L} = \frac{V}{I} ................ 2

Given that; V = 240V, f = 50Hz, \pi = \frac{22}{7}, I = 15A, so that;

From equation 2,

X_{L}= \frac{240}{15}

    = 16Ω

To determine the inductance of the inductor,

X_{L} = 2\pifL

L = \frac{X_{L} }{2 \pi f}

  = \frac{16}{2*\frac{22}{7}*50 }

 = 0.05091

The inductance of the inductor is 0.051H.

4 0
3 years ago
Find the following for an input of 120 VAC(RMS), 60 hertz, given a 10:1 stepdown transformer, and a full-wave bridge rectifier.
atroni [7]

Answer:

(i) 169.68 volt

(ii) 16.90 volt

(iii) 16.90 volt

(iv) 108.07 volt

(v) 2.161 A

Explanation:

Turn ratio is given as 10:1

We have given that input voltage v_p=120volt

(i) We know that peak voltage is give by v_{peak}=\sqrt{2}v_p=\sqrt{2}\times 120=169.68volt

(ii) We know that for transformer \frac{v_p}{v_s}=\frac{n_p}{n_s}

So \frac{169.08}{v_s}=\frac{10}{1}

v_s=16.90volt

So peak voltage in secondary will be 16.90 volt

(iii) Peak voltage of the rectifier will be equal to the peak voltage of the secondary

So peak voltage of the rectifier will be 16.90 volt

(iv) Dc voltage of the rectifier is given by v_{dc}=\frac{2v_m}{\pi }=\frac{2\times 1.414\times 120}{3.14}=108.07volt

(v) Now dc current is given by i_{dc}=\frac{v_{dc}}{R}=\frac{108.07}{50}=2.1614A

4 0
3 years ago
What precautions should be taken to avoid the overloading of domestic electric circuits.
madam [21]

The precautions that should be taken to avoid the overloading of domestic electric circuits are:

  1. Do not put high voltage wires in one socket.
  2. Do not use many electric appliances of high power at the same time.
<h3>What are electric circuits?</h3>

Electric circuits are wires or devices that give electricity to devices that run on electricity. Running of electric devices should be done carefully because our body can come in contact with the current.

Thus, the precautions are to keep high voltage lines away from one socket. Use only a few high-power electric appliances at once.

To learn more about electric circuits, refer to the below link:

brainly.com/question/28221759

#SPJ4

4 0
2 years ago
Other questions:
  • As Becky was driving "Old Betsy," the family station wagon, the engine finally quit, being worn out after 171,000 miles. It can
    12·1 answer
  • A contractor is planning on including several skylights in each unit of a residential development. What type of worker would she
    12·1 answer
  • How many power station do we have​
    14·1 answer
  • Dampers dampers springs are used inside some valve spring to
    10·1 answer
  • Water is pumped from one large reservoir to another at a higher elevation. If the flow rate is 2.5 ft3 /s and the pump delivers
    12·1 answer
  • I need answers for this sheet please.
    15·1 answer
  • Carbon dioxide (CO2) expands isothermally at steady state with no irreversibilities through a turbine from 10 bar, 500 K to 2 ba
    15·1 answer
  • Ronny wants to calculate the mechanical advantage. He needs to determine the length of the effort arm and the length of the load
    7·1 answer
  • Why is electricity considered a secondary source of energy
    6·1 answer
  • Assume the availability of an existing class, ICalculator, that models an integer arithmetic calculator and contains: an instanc
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!