# Given a number % and // can be used to get each digit. For a three-digit number 

# user_val like 927 

ones_digit = user_val % 10 
# 927 / 10 = 92 because 10 X 92 = 920 
# Remainder 927 - 920 = 7 
# Answer = 7


tmp_val = user_val // 10 
# 927 /10 = 92.7
# 927 // 10 (Drop the decimal) = 92

tens_digit = tmp_val % 10 
#927 / 10 = 92
# tens digit = 92  % 10 
# % gives the remainder when dividing by 10 
# 92 / 10: 
# 10 goes into 92 9 (Because 10 x 9 = 90)
# Remainder = 92-90 = 2
# Answer = 2 

tmp_val = tmp_val // 10 

#92 / 10 = 9.2 
# 92// 10 = 9 

hundreds_digit = tmp_val % 10 
# 927 / 10 = 92 
# 92 / 10 = 9.2
# 10 *9 = 90 
# 92 - 90 = 2 
# Remainder 2 



#integer user_input is read from input. Assume user_input is greater than 1000 and less than 99999. Assign thousands_digit 
# with user_input thousands place value 

user_input = int(input())

thousands_digit = (user_input // 100000)  % 10
print ('Value in thousands place:', thousands_digit)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: