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-15 12:59:38 +01:00
filename = input("Input the Filename: ")
f_extns = filename.split(".")
print ("The extension of the file is : " + repr(f_extns[-1]))