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
2. What is an important aspect of the American free enterprise system that encourages people to
rusak2 [61]
Have a positive mindset and attitude
7 0
3 years ago
Read 2 more answers
Plz solve the problem
julsineya [31]
I attached a photo that explains and gives the answer to your questions. Had to add a border because the whole picture didn’t fit.

6 0
3 years ago
Air enters a compressor operating at steady state at 1 bar, 290 K, with a mass flow rate of 0.1 kg/s and exits at 980 K, 10 bar.
stiv31 [10]

Answer:

7.615 kW

Explanation:

Solution in pen paper form in the attachment section

8 0
3 years ago
Investigating how slime molds reproduce is an example of applied research.<br> True<br> False
azamat

Answer:

false

Explanation:

3 0
3 years ago
Which of the following headlines about the French Revolution is not true?
Sever21 [200]

Answer:

d) "Napoleon Declares Himself Holy Roman Emperor"

Explanation:

The French Revolution is defined as a period of the major social upheaval which began in the year 1787 and lasted till year 1799. This revolution completely redefined the the very nature of the political power in France. and also the relationship between the rulers of France and the people they governed.

The 1789 Estates-General was the 1st meeting since year 1614 of the French Estates-General. It is a general assembly which represents the French estates of  realm.

During the French revolution was at peak, the National Assembly issued the Declaration of the rights of the man to the public.

Maximilien Robespierre was considered to be one of the most influential figure and most important statesman during the French Revolution.

Thus all the options (a),(b) and (c) are headlines about the French Revolution, except option (d).

3 0
3 years ago
Other questions:
  • Why should engineers avoid obvious patterns?
    13·2 answers
  • Fatigue failure occurs under the condition of (a) High elastic stress (b) High corrosivity (c) High stress fluctuations (d) High
    9·1 answer
  • Considering the two tables below called Orders and OrderLines, how many rows would be returned by this SQL query? SELECT o.Order
    10·1 answer
  • How did engineers help to create a ceiling fan
    8·1 answer
  • WARNING:<br><br> when people put links in the answer it is a virus DO NOT DOWNLOAD IT
    15·2 answers
  • A two-bus power system is interconnected by one transmission line. Bus 1 is a generator bus with specified terminal voltage magn
    6·1 answer
  • An isothermal CSTR with a first order irreversible reaction A â&gt; B (and rA[mol/(ft3*min)] = - 0.5 CA) has a constant flow rat
    13·1 answer
  • Need help with these 3 ez questions pls help me will mark brainiest.
    15·1 answer
  • Two sites are being considered for wind power generation. On the first site, the wind blows steadily at 7 m/s for 3000 hours per
    5·1 answer
  • Shane's 100-watt radio draws 7 amps of current on a 120-volt circuit. What is the resistance in the radio?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!