Answers for "only get last statement in a loop python"

1

python get last element of iterator

*_, last = iterator # for a better understanding check PEP 448
print(last)
Posted by: Guest on October-21-2021
1

python print last 3

message = iloveyouchina
#get last x words
#for example x = 3
print(message[-3:]
Posted by: Guest on July-09-2020

Code answers related to "only get last statement in a loop python"

Python Answers by Framework

Browse Popular Code Answers by Language