last two characters of a string in Python

 last two characters of a string in Python

it’s very simple to get last two character of any string. it can be done by fetch from last two characters of string, with the help of example it can be understand very easily-

  1. x="abcefgh" 
  2. print(x[len(x)-2:])

Comments

Popular posts from this blog

Proassignmenthelp index 28

HackerRank Question: Print Function

Programmingshark index 18