Posts

Showing posts with the label first and last digits of a number

first and last digits of a number

  first and last digits of a number          n=input()      l=[]      k=len(n)      for i in range(k):            if(i==0 or i==k-1):              l.append(n[i])      for i in l:          print(i)