PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#heres a mix of my frist program usingclass and turtle commands i thnk its more suited to run in python idle rather than solo learn idle hope u enjoy
#it might become not be most efficient one but practice makes a mortal better or so they say
#i have restricted input to upto five coordinates
import turtle
class points:
def __init__(self,name,x=0,y=0):
self.name=name
self.x=x
self.y=y
xx=self.x
yy=self.y
# distance from origin
def disorigin(xx,yy):
return (xx**2 + yy**2)**(1/2)
#plotting points
def graphshow(l):
for i in l:
pen=turtle.Turtle()
pen.color('black')
pen.goto(getattr(i,'x'),getattr(i,'y'))
#drawing axis
def caxis():
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run