In your loop your variable "p" starts from 0 and increment until 268. Imagine this variable is the page number, but page 0 is the first page for you and not page 1 like normal.
You know that you will have to add +15 to the url from the second page.
So:
1)You will multiplicate your current page number with 15 and will keep the result in a new variable after the loop start(before the "url" variable) , ex: newvar = p*15
2)After the variable declaration on the next line you need to see if your "newvar" is bigger than 0!
if var "newvar" is bigger than 0:
the variable "url" will hold the url from your last photo "Code.PNG" but instead of '+ 15+ str(p)+' you replace with '+str(newvar)+'
else:
the variable "url" will hold the naked link(original one like in your first photo, Topic 1.PNG)
3) Why we need to check if newvar is bigger than 0? Because for page 0 "newvar" will be 0 (the result of the ecuation p*15), and from page 1 newvar will be a multiple of 15, like 15, 30, 45, etc.
I hope you understand my english!