To find the percentage of cookies that contain peanuts, you can use the formula:
\[ \text{Percentage} = \left( \frac{\text{Number of cookies containing peanuts}}{\text{Total number of cookies}} \right) \times 100 \]
In this case, Liam has 7 cookies that contain peanuts out of a total of 20 cookies. Therefore, we can substitute the numbers into the formula:
\[ \text{Percentage} = \left( \frac{7}{20} \right) \times 100 \]
Now, calculate \( \frac{7}{20} \):
\[ \frac{7}{20} = 0.35 \]
Next, multiply by 100 to convert it to a percentage:
\[ 0.35 \times 100 = 35 \]
Thus, the percentage of cookies that contain peanuts is:
\[ \boxed{35%} \]