Penny buys 4 pairs of socks for $2 x 4 = $<<4*2=8>>8.

In total, Penny spent $8 + $7 = $<<8+7=15>>15 on 4 pairs of socks and a hat.

Penny has $20 -$15 = $<<20-15=5>>5 left after buying 4 pairs of socks and a hat.

# Answer

5
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Penny has $20. Penny buys 4 pairs of socks for $2 a pair and a hat for $7. How much money does Penny have left?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
5
Penny has $20. Penny buys 4 pairs of socks for $2 a pair and a hat for $7. How much money does Penny have left?
train