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
jenyasd209 [6]
4 years ago
9

Write code to compare two numbers. The code should check whether the first number is less than or equal to the second and then d

isplay the result on the serial monitor.
Physics
1 answer:
belka [17]4 years ago
7 0

Answer:

Explanation:

I will be using Python 3 syntax in writing the code.

- First we need to define a Function 'compare_number' that parse in 2 variables x and y to be compared.

- Then we use the conditional statement if/else to check for the conditions.

- Finally, we will return a Boolean operator True/False or rather print out the statement result to the console. The code is as shown below.

def compare_numbers (x, y):

if x <= y:

return True

else:

return False

compare_number (2,3)

Since 2 is less than 3, the result that will be displayed on the console will be True.

You might be interested in
6. An earthquake releases two types of traveling seismic waves, called transverse and longitudinal waves. The average speed of t
zubka84 [21]

Answer:

The distance away the center of the earthquake is 1083.24 km.

Explanation:

Given that,

Speed of transverse wave = 9.1\ km/s

Speed of longitudinal wave = 5.7 km/s

Time = 71 sec

We need to calculate the distance of transverse wave

Using formula of distance

d=v\times t

d=9.1\times t....(I)

The distance of longitudinal wave

d=5.7\times (t+71)....(II)

From the first equation

t=\dfrac{d}{9.1}

Put the value of t in equation (II)

d =5.7\times(\dfrac{d}{9.1}+71)

\dfrac{9.1d-5.7d}{9.1}=71\times5.7

d0.3736=404.7

d =1083.24\ km

Hence, The distance away the center of the earthquake is 1083.24 km.

6 0
3 years ago
A solid of density 8000 kgm.. weighs 0.8 kgf in air. When it is completely
ad-work [718]

Answer:<em> 0.5kg</em>

Explanation:

5 0
3 years ago
Which is true of a mechanical wave?
mario62 [17]
A mechanical wave must have a medium.

Hope this helps,
♥<em>A.W.E.<u>S.W.A.N.</u></em>♥
6 0
3 years ago
Read 2 more answers
The ice skaters partner liftes her up a distance of 1 m work done or not work done
SOVA2 [1]

Answer:

Work done.

Explanation:

The skater who lifts has to overcome the partner's weight. When lifted up by 1 meter, her potential energy increases by (mass)x(gravitational acceleration)x(1meter), which is the amount of work done.

(This all assumes lifting vertically and no other forces being part of the picture)

5 0
3 years ago
When two waves in the same medium hit each other, the resulting displacement of the medium is
Irina-Kira [14]

Answer:

1. Either larger or smaller than the displacement of either wave acting alone, depending on the signs of the displacements of the two waves.

7 0
4 years ago
Other questions:
  • Three point charges are arranged on a line. Charge q3 = +5.00 nC and is at the origin. Charge q2 = -2.00 nC and is at x = 5.00 c
    6·1 answer
  • How do electromagnetism and gravitation differ from the strong and weak nuclear forces?
    11·1 answer
  • Question 1
    8·1 answer
  • Delete question please
    15·1 answer
  • How many quantum numbers are needed to describe the energy state of an electron in an atom?
    7·1 answer
  • What is the force on an object that goes from 35m/s to 85 m/s in 20 seconds and has a mass of 148kg?
    5·1 answer
  • Vinny is on a motorcycle at rest, 200 m away from a ramp that jumps over a gully. Calculate the minimum constant acceleration Vi
    9·1 answer
  • if a person can jump 2m in earth surface how high can he jump in the moon (g of moon = 1.66m/s, g of earth = 9.8 m/s) [hint: use
    8·1 answer
  • Which of the following would have the highest kinetic energy? *
    9·1 answer
  • A truck of mass 10000kg moving through a sloppy road of length 20km with the help of 5000N force. If the truck climbs the vertic
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!