if(i-words < 0):
start_point = 0
else:
start_point = i - words
Or is this the easiest way using min/max? This is for lists splicing.
I want start_point to always be 0 or above.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Better is to make the limiting more obvious
This way, anyone reading can see that you’re limiting a value.
Using any form of
ifhas the disadvantage that you compute twicei - words. Using a temporary for this will make more code bloat.So, use
maxandminin these cases.