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
For the same cross-sectional area, which column provides the higher buckling load: a circular bar or a circular tube?
juin [17]

Answer:

Circular tube

Explanation:

Now for better understanding lets take an example

Lets take

Diameter of solid bar= 4\sqrt{2} cm

Outer diameter of tube =6 cm

Inner diameter of tube=2 cm

So from we can say that both tubes have equal cross sectional area.

We know that buckling load is given as P = \dfrac{\pi ^2EI}{L_e^2}      

If area moment of inertia(I) is high then buckling load will be high.

We know that  area moment of inertia(I)

For circular tube I = \dfrac{\pi }{64}(D_o^4-D_i^4)

For circular bar I = \dfrac{\pi }{64}D^4  

Now by putting the values

    For circular tube I=62.83 cm^4

  For circular bar I=50.26 cm^4

So we can say that for same cross sectional area the  area moment of inertia(I) is high for tube as compare to bar.So buckling load  will be higher in tube as compare to bar.

3 0
3 years ago
A 400-m^3 storage tank is being constructed to hold LNG, liquefied natural gas, which may be assumed to be essentially pure meth
GuDViN [60]

Answer:

mass of LNG: 129501.3388 kg

quality: 0.005048662

Explanation:

Volume occupied by liquid:

400 m^3*0.9 = 360 m^3

Volume occupied by vapor

400 m^3*0.1 = 40 m^3  

A figured with thermodynamic properties of saturated methane is attached. Notice that a liquid-gas mixture is present

For liquid phase specific volume (vf) at 150 K is 0.002794 m^3/kg and for vapor phase specific volume (vg) is 0.06118 m^3/kg

From specific volume definition:

vf = liquid volume/liquid mass

liquid mass = liquid volume/vf

liquid mass = 360 m^3/0.002794 m^3/kg

liquid mass = 128847.5304 kg

vg = vapor volume/vapor mass

vapor mass = liquid volume/vg

vapor mass = 40 m^3/0.06118 m^3/kg

vapor mass = 653.8084341 kg

total mass = 128847.5304 kg + 653.8084341 kg = 129501.3388 kg

Quality is defined as the ratio between vapor mass and total mass

quality =  653.8084341 kg/129501.3388 kg = 0.005048662

4 0
3 years ago
A long, cylindrical, electrical heating element of diameter 10 mm, thermal conductivity 240 W/m·K, density 2700 kg/m3, and speci
Slav-nsk [51]

Answer:

Answer for the question is given in the attachment .

Explanation:

4 0
3 years ago
What is the basic formula for actual mechanical advantage?
slavikrds [6]

Answer:

Mechanical Advantage Formula

The efficiency of a machine is equal to the ratio of its output to its input. It is also equal to the ratio of the actual and theoretical MAs. But, it does not mean that low-efficiency machines are of limited use. An automobile jack, for example, have to overcome a great deal of friction and therefore it has low efficiency. But still, it is extremely valuable because small effort can be applied to lift a great weight.

Also, in another way the mechanical advantage is the force generated by a machine to the force applied to it which is applied in assessing the performance of the machine.

The mechanical advantage formula is:

MA = FBFA

Explanation:

MAmechanical advantageFBthe force of the object

FAthe effort to overcome the force

3 0
3 years ago
Which of the followong parts does not rotate during starter operation? A. Commutator segments B. Armature windings c. Field wind
photoshop1234 [79]

Answer: B

Explanation: unless newer models added wingding to code inside fused computer...wingdings on a window ...not a motor

8 0
2 years ago
Other questions:
  • A cylindrical bar of steel 10.1 mm (0.3976 in.) in diameter is to be deformed elastically by application of a force along the ba
    15·1 answer
  • Please read
    6·1 answer
  • A piston-cylinder device contains 0.15 kg of air initially at 2 MPa and 350 °C. The air is first expanded isothermally to 500 kP
    15·1 answer
  • Local technology is foundation for modern technology? justufy this statement with example.​
    12·1 answer
  • Which is the correct definition of schematic? a type of computer program that project managers use to track engineers on a proje
    13·1 answer
  • 1. Using the formula above, complete this task.
    9·1 answer
  • An op-amp differential amplifier is built using four identical resistors, each having a tolerance of ±5%. Calculate the worst p
    14·1 answer
  • Writing an excellent problem statement will not help guide you through the rest of the process and steer you towards the BEST so
    8·1 answer
  • Which process made making copies of technical drawings easier?
    8·1 answer
  • Explain the importance of water quality in aquaculture business.
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!