I've found that HackerRank is a great place to practice. The site doesn't really teach you anything, it's up to you to look up how to code, however it's a good place to learn by solving common problems in cs. They provide you test cases you need to satisfy and you get points for it. It's somewhat motivating to get graded.
Coursera, udacity for beginner stuff and then books on your chosen subject matter after that. After you have the basics down books are by far the most cost efficient way of learning.