To express the number of peppermints Riley has, we start with the number of peppermints Troy has, which is represented by \( p \). Since Riley has 4 fewer peppermints than Troy, we can write the expression for the number of peppermints Riley has as:
\[ p - 4 \]
So, Riley has \( p - 4 \) peppermints.