All pastes #747438 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-24 01:10 UTC
rendered paste body
number = 122
number = 97

number = str(number)
hundreds = int(number [0])

print hundreds

// This works if number was 122 it will return "1" which is the hundreds column
// However, in the case of 97, 9 becomes the "hundreds" place value and if I was to call "ones" digit using this method it will be out of range