It's okay.
I prefer typing it myself if it is very little code (for introductory tutorials it usually is, for domain-specific ones it varies), because I have more time to think about it. Never copy without understanding it, it's a very common mistake I see in rookies code.
If you think you understood, then there's the more tricky part. You have to question yourself if you really understood; this is especially important if it seems trivial, because, I've found out, that there's some sort of bias where I tend to conflate true understanding with whatever I think is common sense. Therefore if you find yourself in the situation where you learn something you had no previous knowledge about easy, test your newly acquired knowledge by modifying the problem with some hypothetical new requirement or constraint and try to solve that—it doesn't really matter that your current need doesn't involve said new requirement or constraint. It doesn't matter if you copy/paste the code, it's the semantics that matter not the syntax.