If I for example had a code like this:
score = 0
loop = true
while loop:
score = (score) + 1
print(score)
But I wanted to only print the new value of score instead of a long list of previous values aswell how would I do that?
If I for example had a code like this:
score = 0
loop = true
while loop:
score = (score) + 1
print(score)
But I wanted to only print the new value of score instead of a long list of previous values aswell how would I do that?
print("Something", end='\r')
This way, any successive output will overwrite this one.
score = 0
while True:
score += 1
print(f"{score} ", end='\r')
Notice that in Python true
is undefined, and unlike C
, C++
, JavaScript
and some other languages, True
and False
are uppercase.