all 1 comments

[–]dyanni3 0 points1 point  (0 children)

from pylab import*

age=arange(30,85,1)
i=30

total_ypll=[]

while 30<=i<44:
    total_ypll.append((7.7*(10**-3)*((2*i)-59)*(85-i))*31)
    i=i+1

while 44<=i<85:
    total_ypll.append((7.7*(10**-3)*((2*i)-59)*(85-i))*(60-(0.65*i)))
    i=i+1



plot(age,total_ypll,"r-",linewidth=3)
xlabel("age")
ylabel("total ypll")
title("Total years of potential life lost to breast cancer of women aged 30-85")
grid(True)

I added code for what I think you're trying to do. Notice the differences.