Removing First and last letter in a String - python - Spicy Coders

Recent

Tuesday, July 18, 2017

Removing First and last letter in a String - python


The program must accept a String value S and remove the first and last characters.
Input Format:
The first line denotes the value of S.
Output Format:
The first line contains the string value after removing the first and last characters in the string S.
Boundary Conditions:
Length of S is from 3 to 200.
Example Input/Output 1:
Input:
Lion
Output:
io
Example Input/Output 2:
Input:
jug
Output:
u
Coding:
n=input()
l=len(n)

print(n[1:l-1])

No comments:

Post a Comment