-In file handling, we operate many files in the program and make multiple file objects, to get the name from the file object we have a 'name' attribute in the python.
Syntax-
fileobject.name
program-
f1=open('file1','w')
f2=open('file2','w')
f3=open('file3','a')
f4=open('file4','x')
print(f1.name)
print(f2.name)
print(f3.name)
print(f4.name)
file1
file2
file3
file4