title: what is the actual range in the range function of python
body: <h3>in the following syntax the range function must give 4 values. So, if the trail ==3 it must be the third attempt. But I had to give the trail ==4 for printing the  &quot;your account is a locked statement&quot;. I got a little confused here.</h3>
  <p>otp = &quot;1945&quot;</p>
  <p>for trail in range (1,5):</p>
  <pre><code>if trail ==4:
      print(&quot;your account has been locked&quot;)
      break
  if trail==3:
      print (&quot;one attempt left&quot;)
  
  enter_otp=input(&quot;enter your otp: &quot;)
  if enter_otp!=otp:
      print(&quot;re enter the otp&quot;)
      
  else:
      name=input(&quot;enter your name&quot;)
  </code></pre>