Created
June 21, 2021 13:54
-
-
Save kitten-owner/fe90df2839e6cd435bfedb3176f892ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #Определите количество пятизначных чисел в шестнадцатиричной системе счисления, которые не оканчиваются чётными цифрами | |
| # и не начинаются с цифры 1 | |
| import itertools | |
| a = list(itertools.product("0123456789ABCDEF", repeat=5)) | |
| count = 0 | |
| for x in a: | |
| if x[0] != "1" and x[0] != "0" and (int(x[-1], 16) % 2) != 0: | |
| count+=1 | |
| print(count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment