To some degree yes. I don't have equipment at home, and being in a different setting does help me get in the zone.
You might look into smaller, individually owned local gyms and then ask whether they offer classes. Their memberships are often cheaper, and your attention/experience might be more personal. Bigger gyms can be a massive headache. I always felt like 24 Hour Fitness was a zoo, especially after work. Parking sucked, finding machines sucked, it just wasn't worth it.
Cross-fit gyms often offer cool classes ranging from core toning to yoga, for about $15/session. They can be expensive for memberships. Mine, for unlimited classes, is $150/month. It's also intensely focused, with small class sizes and ass-kicking workouts, so it's worth it to me. No major gym can offer that.
Hot yoga does wonders too, I've heard. My sister swears by it, and so do many of my female friends.
Other than that you can run, do pushups, buy a few weights, and do about a thousand different amazing workouts on your own for free.