Python:图形尝试中的NUmber失败2

时间:2015-12-17 14:40:25

标签: python pseudocode

所以这是尝试2制作二次图,y = x ^ 2 + 3 当我必须在y轴侧有19,18,17时,我有19 17 7等号 我的x轴方面我已经成功地完成了它,但是我无法像y轴那样制作线条。我的星星(点)我也无法编辑。:( x = 0 x = 4

尝试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=''),

如果你能添加一些伪代码

那就太好了

0 个答案:

没有答案