programming-examples/python/Basics/Input a filename and print the extension of that.py

3 lines
135 B
Python
Raw Normal View History

2019-11-18 14:44:36 +01:00
filename = input("Input the Filename: ")
f_extns = filename.split(".")
print ("The extension of the file is : " + repr(f_extns[-1]))