One loop prints the numbers 1 up to your number. In the lesson, range(1, 6) gives 1 to 5; here the end is your number + 1, so the loop stops at your number. Change the number and run again.
Try this: Change the number to 3 and press Run again — only 1, 2 and 3 print.
Press Run to see the output here.