title: The logical error or test case error in python
body: <p><strong>Handling Expection</strong></p>
  <p><strong>The full question is of Hackerrank. I have passed all the test cases but one test case is failing. I don't know why. Logic is correct. Please help me</strong></p>
  <p><strong>test case in given question</strong></p>
  <p>*
  4500(membership fee)</p>
  <p>3(number of installments)</p>
  <p>Welcome boy(name)</p>
  <p>*</p>
  <p><strong>my code is</strong></p>
  <pre><code>def Library(memberfee, installment, book):
      if(installment &gt; 3):
          print(&quot;Maximum Permitted Number of Installments is 3&quot;)
      
      else:
          if(installment == 0):
              print(&quot;Number of Installments cannot be Zero.&quot;)
          else:
              print(&quot;Amount per Installment is  {}&quot;.format(memberfee/installment))
              ListOfBooks = [&quot;philosophers stone&quot;, &quot;chamber of sec rets&quot;, &quot;prisoner of azkaban&quot;, &quot;goblet of fire&quot;, &quot;order of phoenix&quot;, &quot;half blood price&quot;, &quot;deathly hallows 1&quot;, &quot;deathly hallows2&quot;]
      
              book =  book.lower()
              if book in ListOfBooks:
                  print(&quot;It is available in this section&quot;)
              else:
                  print(&quot;No such book exists in this section&quot;)
  if __name__ == '__main__':
      
      memberfee = int(input())
      installment = int(input())
      book = input()
      
      try:
          Library(memberfee,installment,book)
          
      except ZeroDivisionError as e:
          print(e)
      except ValueError as e:
          print(e)
      except NameError as e:
          print(e)
  </code></pre>
  <p>**i think the problem may be here</p>
  <pre><code> print(&quot;Amount per Installment is  {}&quot;.format(memberfee/installment))
  </code></pre>
  <p>**</p>
  <p><strong>The question is.....</strong></p>
  <p>*Library</p>
  <p>This exception handling scenario deals with the exceptional cases that arise in a typical library interface of a Town library.</p>
  <p>O</p>
  <p>1</p>
  <p>About the Library Interface</p>
  <p>This is a typical interface provided in the library, which takes 3 inputs from the library members, sequentially. They are:</p>
  <ol>
  <li><p>memberfee - Membership fee for the library for the next financial year, which can be paid in installments.</p>
  </li>
  <li><p>installment - Number of installments chosen to pay the Membership fee. 3. book- Name of the book the member looks for in the 'Harry Potter' Section.</p>
  </li>
  </ol>
  <p>23</p>
  <p>24</p>
  <p>25</p>
  <p>26</p>
  <p>27</p>
  <p>28</p>
  <p>29</p>
  <p>30</p>
  <p>Note</p>
  <p>All the above inputs except 'book' are Integers.</p>
  <p>Write the function definition as follows, for the function 'Library', that takes all the above 3 inputs as its parameters:</p>
  <p>The maximum permitted number of installments to pay the annual membership fee is '3'.</p>
  <ol>
  <li>Raise ValueError exception if the input for the number of installments is greater than '3' and Print a Message. The message to the user must be, &quot;Maximum Permitted Number of Installments is 3&quot;, The amount per installment is calculated by dividing the Membership fee by the number of installments. 2. Raise ZeroDivision Error exception if the input for the number of installments is equal to '0' and Print a Message. The message to the user must be, &quot;Number of Installments cannot be Zero.&quot; else</li>
  </ol>
  <p>1</p>
  <blockquote>
  <p>#!/bin/python</p>
  </blockquote>
  <p>10</p>
  <p>11</p>
  <p>def Library (</p>
  <p>if(insta</p>
  <p>prin</p>
  <p>else:</p>
  <p>if(</p>
  <p>els</p>
  <p>(memberfee</p>
  <p>sec rets&quot;,</p>
  <p>phoenix&quot;,</p>
  <p>hallows 2&quot;1</p>
  <p>Print the amount per installment as &quot;Amount per Installment is 3000.0&quot;.</p>
  <p>12</p>
  <p>13</p>
  <p>The 'Harry Potter' book section contains the following books only:</p>
  <p>14</p>
  <p>ALL</p>
  <p>1</p>
  <p>15</p>
  <p>philosophers stone</p>
  <p>16</p>
  <p>. chamber of secrets</p>
  <p>17</p>
  <p>• prisoner of azkaban</p>
  <p>18</p>
  <p>19</p>
  <p>• goblet of fire</p>
  <p>• order of phoenix</p>
  <p>half blood prince</p>
  <p>deathly hallows 1</p>
  <p>21</p>
  <p>23</p>
  <p>20</p>
  <p>24</p>
  <p>• deathly hallows 2*</p>