Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- result = 0
- value = 100 # 107, 117, 276
- checked = 7
- # --- first place ---
- result += (value // 10) * 1
- rest = value % 10
- if rest >= checked * 1:
- result += 1
- # --- second place ---
- result += (value // 100) * 10
- rest = value % 100
- if rest >= checked * 10:
- result += 1
- # --- third place ---
- result += (value // 1000) * 100
- rest = value % 1000
- if rest >= checked * 100:
- result += 1
- # --- etc.
- print('result:', result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement