Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
loop = true
true
score = (score) + 1
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.
C
C++
JavaScript
True
False
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
loop = trueis invalid (trueis undefined name). And braces are redundant inscore = (score) + 1