0

So this is attempt 2 to make a quadratic graph, y=x^2+3 I have 19 17 7 etc numbers when I have to have 19,18,17 on the y axis side and my x axis side I have successfully made it go across but I wasn't able to make the lines like y axis. Also my stars(the dots) I couldn't edit.:( x=0 x=4

Attempt 2

##David Jeon
##Dec 16, 2015
##A program to plot the graph of y = x^2 + 3 using formatted output
##ICS201
##Graph from x = 0 to x = 4
##program to create a y=x^2+3 graph
print('{0:>{width}}'.format('y', width=2))
x = 4
y = x**2+3
oldY = y
for x in range(4,-1,-1):
print('{0:>3}{1:>{width}}'.format(str(y)+'|','*', width=x**2))
y = x**2+3
difference = oldY - y
print('{0:>{width}}'.format('x', width=20)),
for x in range(4,-1,-1):
    print (4-x, end=''),

And it would be great if you could add some pseudo code

SweetTech
  • 17
  • 5

0 Answers0