While most online resources do have some interactive tests or challenges you can take that allows you to actually code, some focus heavily on having you practice which I believe is the best way to get better at coding.
Source: Learn by Doing: The 8 Best Interactive Coding Websites