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
Mariana [72]
3 years ago
11

(10 points) Make a user interface to get 3 points from the user which will be placed on the coordinate plane. Then write a Pytho

n3 function to check whether the points entered forms a right triangle. And another Python3 function to check whether the points entered forms a equilateral triangle. Call your functions for three user-entered points on the coordinate plane.
Computers and Technology
1 answer:
babymother [125]3 years ago
3 0

Answer:

def cord_input():

Global coordinates

coordinates = {'x1': 0, 'y1': 0, 'x2':0, 'y2':0, 'x3':0, 'y3':0}

for key, i in enumerate(coordinates.keys()):

if i < 2:

index = 1

coordinates [key] = float(input(f"Enter {key} coordinate for point {index}: "))

elif i >= 2 and i < 4:

index = 2

coordinates [key] = float(input(f"Enter {key} coordinate for point {index}: "))

else:

index = 3

coordinates [key] = float(input(f"Enter {key} coordinate for point {index}: "))

def sides(p1, p2, p3):

nonlocal a, b, c

a = ((p2[0] - p1[0])**2) + ((p2[1] - p1[1])**2)

b = ((p3[0] - p2[0])**2) + ((p3[1] - p2[1])**2)

c = ((p3[0] -p1[0])**2) + ((p3[1] - p2[1])**2)

def is_right_triangle(p1, p2, p3):

sides(p1, p2, p3)

if a+b == c or b+c == a or a+c == b:

print(f"Sides {a}, {b} and {c}")

return True

else:

return False

def is_equilateral(p1, p2, p3):

sides(p1, p2, p3)

if a==b and b==c:

print(f"Sides {a}, {b} and {c}")

return True

else:

return False

cord_input()

Explanation:

The python code above defines four functions, cord_input (to input a global dictionary of coordinates), sides ( to calculate and assign the sides of the triangle), is_right_triangle ( to check if the coordinates are for a right-angle triangle), and is_equilateral for equilateral triangle check.

You might be interested in
Item 19 A student pushes a box across a rough horizontal floor. If the amount of work done by the student on the box is 100 J an
tatiyna

Answer:

60 J

Explanation:

Given,

Work done to push the box = 100 J

Energy dissipated by friction = 40 J.

According to work energy theorem work done is equal to change in kinetic energy.

Change in Kinetic energy = Work done by student + Work done by friction

Change in Kinetic energy = 100 J - 40 J

Work done by the friction will be negative because it will act in opposite direction of force applied.

Change in Kinetic energy = 60 J

4 0
4 years ago
What is an input and output device? Give examples.​
yanalaym [24]

Answer:

input devices are a piece of equipment used to provide data to the computer examples:  mouse, keyboard, scanner, camera, etc

output devices are any piece of computer hardware equipment which converts information into a human readable form examples: printer, monitor, and others

6 0
3 years ago
When you pass an array to a method, the method receives ______.
7nadin3 [17]
The correct option is 3.
When an array is passed as a parameter to a function, it is usually passed as a reference parameter. What is actually passed is the address of its first element. Since arrays are typically passed by reference, it means that if the function changes the value of an element in an array, then the corresponding actual array will change that element. To declare an array of real values as parameter one has to specify the parameters.
4 0
3 years ago
PLEASE HELP! I'm offering brainliest!
Marina CMI [18]

Answer:

1. Undo  2. Font Type   3. Font Size  4. Bold Font 5. <em>Italics  </em>6. Word Color  7.  Document Margins

Explanation:

Did you know that all of these answers are how to format a document?

7 0
3 years ago
Find prime no using Java
bonufazy [111]

Answer:

Um

Explanation:

I don't understand

4 0
3 years ago
Other questions:
  • Assume the existence of a Building class with a constructor that accepts two parameters:_________ a reference to an Address obje
    5·1 answer
  • John, an ethical hacker, is demonstrating a proof-of-concept IoT attack. For this demonstration, he used a jammer to jam and sni
    5·1 answer
  • Design pseudocode for a program that will permit a user to store exactly 50 numbers in an array. Create an array big enough to h
    10·1 answer
  • When the condition of an if statement is false, the computer will return an error message to the user.
    15·2 answers
  • Why vechiles Tyres are black in colour?​
    14·1 answer
  • Write any four common hardware devices​
    6·1 answer
  • Hahaahhaahahuahaahahhahqha
    13·1 answer
  • Which of the following would be the most appropriate way to define a method that calculates and returns the final price, after t
    13·1 answer
  • During an IFR flight in IMC, you enter a holding pattern (at a fix that is not the same as the approach fix) with an EFC time of
    12·1 answer
  • What is a major advantage of medical simulators?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!