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'
Python code to count the number of occurrences in list
Write a Python program to display the current date and time
Python program to print formatted string
List to string conversion in python
Python program to display the first and last colors from the following list
Python Program to check if a string is palindrome or not
Python Program to sort alphabetically the words form a string provided by the user
Write a Python program to test whether a number is within 100 of 1000 or 2000
Python Program to find the area of triangle
Return list by function in python
String to list conversion in python
Python program to find the largest of three numbers
Python program to print the calendar of a given month and year
Python program to find the Factorial of any number