Thanks for sharing and in #Create optimization Function, the code should be modified as follows.
Create optimization Function
total_views = ' '
print('Optimization function: ' + str(total_views))
Very nice code and idea. Thank you for sharing. I used pulp.LpAffineExpression and dictionaries to define the objective function and constraint equations, it worked well.
I should also mention that one would get a different list with and without rounding. I guess this is because of the rounding process.