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]
4 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]4 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
Wastewater flows into a _________ once it is released into a floor drain.
rodikova [14]

Answer:

A) Sump pit

Explanation:

A wastewater typically refers to a body of water that has contaminated through human use in homes, offices, schools, businesses etc. Wastewater are meant to be disposed in accordance with the local regulations and standards because they are unhygienic for human consumption or use.

Generally, many homes use a floor drain in their bathrooms and toilets to remove wastewater in order to mitigate stagnation and to improve hygiene. A floor drain can be defined as a material installed on floors for the continuous removal of any stagnant wastewater in buildings. Wastewater flows into a sump pit once it is released into a floor drain through the use of a pipe such as a polyvinyl chloride (PVC) pipe, which directly connects the floor drain to the sump pit. The wastewater can the be removed from the sump pit when it is filled up through the use of a pump.

6 0
3 years ago
Two soils are fully saturated with liquid (no gas present) and the soils have the same void ratio. One soil is saturated with wa
mariarad [96]

Answer:

water sample have more water content

Explanation:

given data

soil 1 is saturated with  water

unit weight of water = 1 g/cm³

soil 2 is saturated with alcohol

unit weight of alcohol  = 0.8 g/cm³

solution

we get here water content that is express as

water content = S_s \times \gamma _w   ....................1

here soil is full saturated so S_s is 100% in both case

so put here value for water

water content = 100 % ×  1

water content = 1 g

and

now we get for alcohol that is

water content  = 100 % × 0.8

water content  = 0.8 g

so here water sample have more water content

5 0
4 years ago
The shape of the wood beam is a rectangle. In a paragraph explain the tradeoffs an engineer would make in selecting a wood with
oksian1 [2.3K]

Answer:

Wood is heavy

Explanation:

7 0
3 years ago
______number can be used to describe the relative growth of the hydraulic boundary layer and the thermal boundary layer. a) Reyn
weqwewe [10]

Answer: d) Prandtl number

Explanation: Prandtl number is basically defined as the ratio between the fluid's viscosity to the thermal conductivity.It doesn't have any sort of dimension. The fluids which are discovered with the small Prandtl numbers are considered as good fluids as they have a smooth rate of flow and as the number increases the fluid are not considered as reliable. Thus,option (d) is the correct option.

3 0
4 years ago
In a 1D compression test with double drainage, the pore pressure readings are practically zero after 8 minutes for a clay sample
frosja888 [35]

Answer:

The duration of the consolidation process for the same clay is 32 min

Explanation:

for clay 1:

t1=0

H1=thickness=2 cm

for the clay 2:

t2=?

H2=2 cm

The time factor is equal to:

T=(\frac{Cv}{d^{2} })t

where Cv is the coefficient of consolidation

(\frac{Cvt}{d^{2} })_{1}=  (\frac{Cvt}{d^{2} })_{2}

if Cv is constant, we have:

(\frac{t1}{(\frac{H1}{2}) ^{2} })_{1}=(\frac{t2}{H2^{2} })_{2}\\\frac{0}{(\frac{2}{2})^{2})  }=\frac{t2}{2^{2} }

Clearing t2:

t2=32 min

3 0
3 years ago
Other questions:
  • A two-fluid heat exchanger has inlet and outlet temperatures of 65 and 40 degree C for the hot fluid and 15 and 30 degree C for
    9·1 answer
  • There are four distinct events that occur in the Carnot cycle. Name the events and describe each one.
    15·1 answer
  • At sea level, the mass of a watermelon is 5 kg in Sl units. Then the weight of it in English units is: _______.
    11·2 answers
  • Two kilograms of oxygen fills the cylinder of a piston-cylinder assembly. The initial volume and pressure are 2 m3 and 1 bar, re
    6·2 answers
  • Light energy produces the only voltage in a solar cell. (a)-True(T) (b)- false(F)
    9·1 answer
  • A 2-m3 rigid tank initially contains air at 100 kPa and 22°C. The tank is connected to a supply line through a valve. Air is flo
    14·1 answer
  • Steven is starting a project that requires a specialized, experienced contractor. Which selection process is the most suitable f
    11·1 answer
  • Plz watch our you tube channel called addie nahoe. I got 8 subscribers. I need 10. Plz like and hit that nocation bell. Plz!!!!
    12·1 answer
  • A PLL is set up so that its VCO free-runs at 8.9 MHz. The VCO does not change frequency unless its input is within plus or minus
    11·1 answer
  • What do you think the top TWO game elements are that directly contribute to player immersion?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!