Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 543 Bytes

Remove_First_and_Last_Character.md

File metadata and controls

33 lines (18 loc) · 543 Bytes

CodeWars Python Solutions


Remove First and Last Character

It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the original string. You don't have to worry with strings with less than two characters.


Given Code

def remove_char(s):
    #your code here

Solution

def remove_char(s):
    return s[1:-1]

See on CodeWars.com