How to print image filename

Instead of making the filename a variable, how can I print the file name of an image without making it a variable?

I tried for example:

print(var1.filename)

but that didnt work.

Anyone know how I can do it?

WOoops sorry dumb post.

I will just make it a variable.

WOoops sorry dumb post.

I will just make it a variable.