andewK

get digit of number

Sep 28th, 2021
971
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def get_digit(number, pos):
  2.     return number // 10 ** pos % 10
  3.  
  4.  
  5. number = int(input())
  6. for i in range(len(str(number))):
  7.     print(get_digit(number, i))
  8.    
RAW Paste Data