0

How do I print last output of a loop?

I have a python code that uses loop for, but when I print the result, it prints every stage. Is it possible to print only the last result?

6th Sep 2020, 10:41 AM
Soul
3 odpowiedzi
+ 5
store the result to a variable everytime loop runs and a new result is calculated and print that variable outside loop
6th Sep 2020, 10:43 AM
Abhay
Abhay - avatar
+ 3
Soul , it would be a good idea to share your code with us. This saves us a lot of time and we don't have to guess. Thanks!
6th Sep 2020, 10:50 AM
Lothar
Lothar - avatar
+ 1
It works Abhay, tysm
6th Sep 2020, 10:52 AM
Soul