6/15


#1

Hello
Why the range is from 2 to x-1 instead x?


#2

its not. we don’t want to include x in the range, to indicate this we write x-1. However, range() function doesn’t include its stop value, so we don’t have to write -1 within the range function call


#3

A post was split to a new topic: Is_prime


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.