Mistři v programování na #hovnokod

Python #490

x = str(x)                                            # x == '987.654'
dot = x.find('.')                                  # dot == 3
whole = x[:dot]                                 # whole == '987'
nums = '0123456789'                     # 
tenths = x[(dot + 1):(dot + 2)]         # tenths == '6'
max_digits = 6                                  # Directions say x is not > 100,000
filler = max_digits - dot                   # filler == 3 (dot is equal to the number of digits in whole)
big_num = ('0' * filler) + whole       # big_num == '000987'

e5 = (nums.find(big_num[0:1])) * 100000   # e5 == 0
e4 = (nums.find(big_num[1:2])) * 10000     # e4 == 0
e3 = (nums.find(big_num[2:3])) * 1000       # e3 == 0
e2 = (nums.find(big_num[3:4])) * 100         # e2 == 900
e1 = (nums.find(big_num[4:5])) * 10           # e1 == 80
e0 = (nums.find(big_num[5:6]))                   # e0 == 7

the_decider = '9'.find(tenths) + '8'.find(tenths) + '7'.find(tenths) + '6'.find(tenths) + '5'.find(tenths) + 5

rounded = (e5 + e4 + e3 + e2 + e1 + e0) + the_decider
print rounded

HovnoKod,