import time
import random
x=random.randint(1,15)
b=float(x)
while x > 0:
print(f’“{b}” second left’)
b -= 0.1
c=100
while c>1:
print(“times up”)
c -= 1
help
import time
import random
x=random.randint(1,15)
b=float(x)
while x > 0:
print(f’“{b}” second left’)
b -= 0.1
c=100
while c>1:
print(“times up”)
c -= 1
help
We can’t see the indentation. Wrap your code in triple backticks ( like this: ``` ) so it is formatted correctly. In the editor, you can select the code and click the </>
button.
If in doubt, print it out. Look at what x
is during this loop.
import time
import random
x=random.randint(1,15)
b=float(x)
while x > 0:
print(f’“{b}” second left’)
b -= 0.1
c=100
while c>1:
print(“times up”)
c -= 1
thanks but x is working fine
it keeps going in the negatives
i used time.sleep() to give me enough time to read x
import time
import random
x=random.randint(1,15)
b=float(x)
print(x)
time.sleep(10)
while x > 0:
print(f'"{b}" second left')
b -= 0.1
c=100
while c>1:
print("times up")
c -= 1
Does it? Did you check?
i used print()
i think i just realized how to fix it
import time
import random
x=random.randint(1,15)
b=float(x)
while => b <= > 0:
print(f'"{b}" second left')
b -= 0.1
c=100
while c>1:
print("times up")
c -= 1
i pointed out which one i changed
thanks
…
yay +++±++++++++++__±===+_