0

In Python What does it mean if the name of the list is used follwoed by an if clause e.g. in the code that I am looking at if listname: listname.pop()

here what does if listname do?

1 Answers1

0

This is simply checking is list is not empty (listname should refer only to the name) and then if it is not empty, it pop's the last element from it.

vukojevicf
  • 609
  • 1
  • 4
  • 22