The equation $4.50h + $2 = $20 shows the cost to play H hours of miniature golf. How many hours of golf were played?

First, we need to isolate the variable $h$ on one side of the equation. We can do this by subtracting $2 from both sides:

$4.50h = $18

Now we can solve for $h$ by dividing both sides by $4.50:

$h = 4$

Therefore, 4 hours of miniature golf were played.