How to check if *args[0] exists?

Viewed 9779

In Python, how can I check if *args[0] exists?

def my_fxn(self, *args):
    print(args[0])

my_fxn('ABC')  # this prints 'ABC'
my_fxn()       # this crashes with "IndexError: tuple index out of range"
3 Answers
Related