Consider:
dt=10**(-3)
for i in range(1,10**7+1):
t=i*dt;
kounter=e**(t*(dt**3))
if t==1000 or t==2000 or t==3000 or t==4000 or t==5000 or t==6000:
print(kounter)
Now the above code in itself might be written in an infinitely better way but that is just to show what I want to do in my actual code in which I want to print the value of a variable at each 1000 step till the end (note in above I did it only till 6000 but I want it till 10,000) which looks absurd if the end time is very large.
I am sure there is a prettier and more efficient way of doing it.
you probably looking for this %
# when the remainder of t divided by 1000 equals zero
if t % 1000 == 0:
print(kounter)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With