I am a beginner in python and started to learn basics. I have a sample program here in python
#Simple Program Python
tf=float(input("Enter total time of run in seconds "))
delt = float(input("Enter the time step of run "))
dx = float(input("Enter the value of dx "))
xf = float(input("Enter the total length of a channel "))
n =float(tf/delt)
#t =range[n]
from array import array
m = xf/dx
for i in range(0,int(n)) :
t[i]=i*tf/n
print("THe total time of run is %r " %tf)
print("seconds")
print("The time step is %r" %delt)
print("Number of steps is %r" %n)
print("The number of space step in X direction is %r " %m)
In the for loop, when I try to assing t[i], then it throws an error "NameError: name 't' is not defined". In some stackoverflow questions, there was suggestions to use
from array import array
But I still get an error. I tried that solution from NameError: name 'array' is not defined in python. PLease help to get rid of this error.
Thanks.
Jdbaba