We can't tell - it's likely to be something just above the code fragment you show that is causing the error, and we can't see that. This may help: How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors
BTW: do yourself a favour and don't learn how to code from YouTube: I'm sure there are good tutorials out there, but most are created by people who don;t know how to teach, don't know how to make a video, and often don't know how to code either. Remember that Youtube is about money: likes and subscribes are currency!
Go on a course, or get a book - Adison Wesley, Wrox, and MS Press all do good ones - and follow it from start to finish doing all the exercises. You will get a much better result than watching youtube!