Reputation: 17
I am trying to loop a script but I want "a" to become whatever "b" ends up being. For eample if my input is 10 b=1000... I then loop it back but want "a" to become 1000 (what b ended up as)....
import threading
import time
while True:
print time.time ()
a=900
input=int(raw_input("enter a number,"))
b=int(((input-5)*20)+a)
print b
Upvotes: 0
Views: 55
Reputation: 61457
Define a
outside the loop:
import threading
import time
a=900
while True:
print time.time ()
input=int(raw_input("enter a number,"))
b=int(((input-5)*20)+a)
a = b
print b
Upvotes: 3