title: Return inside if condition
body: <pre><code>   def hi (n):
      if n&lt;=5:
          print("we are inside hi")
          n+=1
          return n
  
  n=1
  hi(n)
  </code></pre>
  
  <p>1) In the above code i have declared a function hi() which takes an input n</p>
  
  <p>2)I want to iterate  inside the if condition until n is less than 5,totally execute the print statement 4 times </p>
  
  <p>3)But it is not working after execution of one time inside the condition </p>
  
  <p>4)I am thinking i have given return statement for <strong>if</strong>  condition but the function is totally being exit </p>
  
  <p>5)(i am thinking i am returning the n value to the if condition and it checks the condition and it will iterate  ) if wrong correct me</p>