Yes, Python and Ruby run on a web server. Look at things like Sinatra and Ruby on Rails for using Ruby on the web and if you’re looking at Python stuff like Django and Flask are your best bet.
Python isn’t bad but it’s not about what’s a good language and what’s a bad language it’s about the best tool for the job. Think of your languages as a tool inside your toolbox: if you take a small bolt and you’re trying to turn it with a spanner 4 sizes too big - you may get there by wedging it in and wiggling it about but in the end it’s gonna take a fuck load more effort than if you just used the right size of spanner.
Once you dibble and dabble across several languages and focus on how they work you can then choose the best language and then the best framework for the job.
Does that make a bit more sense?