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
Who was part of dempwolf his firm when he first started
Zinaida [17]

Explanation:

Dempwolf created by John Augustus, Among the most prominent innovative solutions in Southern California Pennsylvania was established by Dempwolf with  brother Reinhardt or uncle's son Frederick entered the company of J.A. Dozens of structures in 10 states were engineered by Dempwolf.

5 0
3 years ago
Methane gas is 304 C with 4.5 tons of mass flow per hour to an uninsulated horizontal pipe with a diameter of 25 cm. It enters a
Arada [10]

Answer:

a) h_c = 0.1599 W/m^2-K

b) H_{loss} = 5.02 W

c) T_s = 302 K

d) \dot{Q} = 25.125 W

Explanation:

Non horizontal pipe diameter, d = 25 cm = 0.25 m

Radius, r = 0.25/2 = 0.125 m

Entry temperature, T₁ = 304 + 273 = 577 K

Exit temperature, T₂ = 284 + 273 = 557 K

Ambient temperature, T_a = 25^0 C = 298 K

Pipe length, L = 10 m

Area, A = 2πrL

A = 2π * 0.125 * 10

A = 7.855 m²

Mass flow rate,

\dot{ m} = 4.5 tons/hr\\\dot{m} = \frac{4.5*1000}{3600}  = 1.25 kg/sec

Rate of heat transfer,

\dot{Q} = \dot{m} c_p ( T_1 - T_2)\\\dot{Q} = 1.25 * 1.005 * (577 - 557)\\\dot{Q} = 25.125 W

a) To calculate the convection coefficient relationship for heat transfer by convection:

\dot{Q} = h_c A (T_1 - T_2)\\25.125 = h_c * 7.855 * (577 - 557)\\h_c = 0.1599 W/m^2 - K

Note that we cannot calculate the heat loss by the pipe to the environment without first calculating the surface temperature of the pipe.

c) The surface temperature of the pipe:

Smear coefficient of the pipe, k_c = 0.8

\dot{Q} = k_c A (T_s - T_a)\\25.125 = 0.8 * 7.855 * (T_s - 298)\\T_s = 302 K

b) Heat loss from the pipe to the environment:

H_{loss} = h_c A(T_s - T_a)\\H_{loss} = 0.1599 * 7.855( 302 - 298)\\H_{loss} = 5.02 W

d) The required fan control power is 25.125 W as calculated earlier above

5 0
3 years ago
What other ways could a wildfire be contained, extinguished, or slowed down?
galben [10]
Back burning, starting fires infront of the main fire to prevent the fire from spreading and depleting fuel for the fire, digging trenches so the fire has no where to go, dropping water from planes or helicopters.
3 0
3 years ago
Resolver em c as equações:<br><br> Z elevado à 2 igual a 3+4i
Marrrta [24]

Answer:

Quando um (ou todos) os outros coeficientes de uma equação do segundo grau são iguais a zero, essa equação é chamada incompleta. Neste artigo, analisaremos os métodos que podem ser usados para resolver equações incompletas, no caso em que o coeficiente C = 0, ou seja, o coeficiente é nulo.

Explanation:

Um lado da equação será a potência e outro, o número inteiro. De outro modo, transforme a equação deixando-a isolada em um dos lados. Reescreva a equação. Prepare-a a fim de extrair o logaritmo de ambos os lados, que é o inverso da potência. Você pode calcular o logaritmo de base.

3 0
3 years ago
ATTENTION ALL BRAINLY USERS!!
elena-14-01-66 [18.8K]

ANSWER  

"Sir Yes Sir"!!!!

Explanation:

thank you for telling me that i have had people answer my question with a length and same happened to other peoples pages

3 0
3 years ago
Other questions:
  • In this exercise, you will write a Point structure that represents a space in two-dimensional space. This Point should have both
    6·1 answer
  • A computer maintenance company wants to 'capture' the knowledge that employees carry around in their heads by creating a databas
    5·1 answer
  • Oil with a density of 850 kg/m3 and kinematic viscosity of 0.00062 m2 /s is being discharged by a 8-mm-diameter, 40-m-long horiz
    5·1 answer
  • Which of the following drivers has the right-of-way?
    9·1 answer
  • Global Courier Services will ship your package based on how much it weighs and how far you are sending the package. Packages abo
    14·1 answer
  • What are the factors of production in business? Land, labor, and capital land, capital, and interest land, labor, and customer b
    10·2 answers
  • An engineer measures a sample of 1200 shafts out of a certain shipment. He finds the shafts have an average diameter of 2.45 inc
    15·1 answer
  • Developed an automated program in any language which take 12 dependent variable and corresponding independent variables and show
    14·1 answer
  • A design that either partially or wholly integrates the bodywork
    6·1 answer
  • If a fuel line is routed through a compartment parallel with an electrical wire bundle, the fuel line should be installed ______
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!