(Oct-08-2019, 06:27 PM)ichabod801 Wrote: I think if you had more descriptive variable names you might figure this out for yourself. You initialize d to a list on line 4, then change it to an integer on lines 7 and 10, and then try to append to it on line 11. It seems like you are mixing d up with something else when you assign integers to it. The else clause is unclear. You have no break statement, so it will always trigger. But it will only run after the while loop is finished, so even if the other problems are fixed, d will only ever have one item in it.
I'm coded break. The graph is now being generated, but another error message has displayed.
a=int(input("a=")) b=int(input("b=")) c=[0,1,2,3,4,5] d=[] x=0 while (x<=a): x=x+50 d=b*(a-x) break else: x=0 d.append(x)ValueError: x and y must have same first dimension, but have shapes (6,) and (1,)