Created
July 16, 2022 22:49
-
-
Save modos/5957c8ec2751c80942ca100908c01837 to your computer and use it in GitHub Desktop.
بازی تفاضل
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_digit(number, n): | |
return number // 10**n % 10 | |
def game(number): | |
x = get_digit(number, 0) | |
y = get_digit(number, 1) | |
return abs(x - y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment