Numbers that are actually letters
Pyth, 43 - 40 = 3 bytes
?&[email protected]"Mix"%"Only %sers"?K"lett""numb
This achieves the bonus. Only numbers
and Only letters
fortunately only differ by 4 letters. printf-style formatting is used with %
.
The selection system is done by both taking the intersection of the hex with G
, the alphabet, and subtracting out G
. If neither ends up falsy, it's a mix, while if the intersection is falsy, it's numbers, and if the subtraction is falsy, it's letters.
Pyth, 6 bytes
!-.HQG
.HQ # Converts the input to hexadecimal
- G # Deletes all letters
! # If empty, output True, else False
Test it here
Jelly, 6 bytes
b16>9P
Try it online!
How it works
b16>9P Input: z
b16 Convert the input to base 16.
>9 Compare each resulting digit with 9; return 1 iff greater.
P Take the product of the resulting Booleans.