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
In the web form you are creating, you want a multiple-option select list to appear with five options. which line of html code wi
suter [353]
You will use a <select> for this. For example:

<select name="choice">
  <option>First</option>
  <option>Second</option>
  <option>Third</option>
  <option>Fourth</option>
  <option>Fifth</option>
</select>
5 0
3 years ago
Which of the following CANNOT incorporate animation
Anarel [89]
Lost the following …
8 0
2 years ago
Can you help please ill give branilist
konstantin123 [22]

HTML uses tags to help the computer know what different pieces of content in the web page actually are. Right now we've only learned how to tell the computer that some text is a paragraph, or that part of your website is the body. We've already seen how that affects the way our web pages look and are structured.

(I don't know how it should be organized, but hope this helped)

3 0
3 years ago
What types of messages flow across an SDN controller’s northbound and southbound APIs? Who is the recipient of these messages se
Marta_Voda [28]

Answer and Explanation:

Messages flow across an SDN controller's:  

Northbound APIs:  

• Messages which help in read/write state of the network and developing flow tables within the  

state management layer.  

• Notifications for the state-change events.  

• The interaction between the controller and network control applications is done through the  

northbound interface.  

• Network control applications send messages to the controller.  

Southbound APIs:  

• Messages which help for the up-to-date view of the network's state like message for the  

attached link has gone up or down, new devices are joined the network, or indications of the  

device is up or down.  

• Controller's southbound interface is the communication among the controller and the controlled  

devices. Controlled devices are the recipients of the messages sent form the controller.  

3 0
4 years ago
RAM memory is considered volatile because this memory is erased when the computer is turned off
Goshia [24]
False because ram is constantly always running
5 0
3 years ago
Other questions:
  • Define inheritance. give an example
    11·1 answer
  • When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memor
    8·1 answer
  • Which of the following best explains the concept of a prototype
    10·1 answer
  • A large population of ALOHA users manages to generate 50 requests/sec, including both originals and retransmissions. Time is slo
    5·1 answer
  • Why did Simon bring Michael home?​
    9·2 answers
  • A ddr4 dimm with a pc rating of pc4-17000 is running at what speed?
    15·1 answer
  • Guess The Song:
    9·1 answer
  • A record is a specific piece of information state true or false​
    12·1 answer
  • Which of the following would be least effective?
    10·1 answer
  • Distinguish between a computer drive and computer driver​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!