simple way of finding file extension python programming

file = input("Which file did you opend last time user:- ")
extenction = file.split(".")
print("humm so last time you opened file extenction was .",extenction[1])

Here is what the above code is Doing:
1. It’s asking the user to input the name of the file he/she opened last time.
2. It’s storing the input in a variable named file.
3. It’s splitting the input string on the basis of the dot (.) character.
4. It’s storing the result of the split in a variable named extenction.
5. It’s printing the result of the split.