I am very new to programming, and have been trying to use python for my research calculations. I need to write a program that does something like this:
If chelDays = [0, 1, 5, 7] For every time t from 1 to 100 , I need t - chelDays for each member of the list chelDays if t > tchelDays. For example, I'd get the following results:see image
Here's what I tried:
chelDays = [0, 1, 5, 7]
while t <100:
if t > tj:
print (t, t-tj)
else:
print (t, " ")
t +=1
Edit:
Finally found my solution:
Tau = (0, 1, 5, 7)
def tMinusTau(t, tj):
if t > tj:
return t-tj
else:
return ""
for t in range(1,100):
print(t, tMinusTau(t,Tau[0]),tMinusTau(t,Tau1),tMinusTau(t,Tau[2]),tMinusTau(t,Tau[3]))