filename = input("Input the Filename: ")
f_extns = filename.split(".")
print ("The extension of the file is : " + repr(f_extns[-1]))
Output:
Input the Filename: abc.java
The extension of the file is : 'java'
filename = input("Input the Filename: ")
f_extns = filename.split(".")
print ("The extension of the file is : " + repr(f_extns[-1]))
Output:
Input the Filename: abc.java
The extension of the file is : 'java'
Increment and decrement operator in python
Python program to Reversing a list using reversed()
Write a Python program to get a string which is n (non-negative integer) copies of a given str
How to add all number in list in python
Return list by function in python
Write a Python program to test whether a number is within 100 of 1000 or 2000
Python Program to sort alphabetically the words form a string provided by the user
Python program to swap two variables
Python Program to generate a random number between 0 and 9
Python program to display the first and last colors from the following list
Python Program to find the area of triangle
Python program to print formatted string
Python program to find maximum in arr[] of size n
Append and read in file handling in python