title: "AttributeError: 'list' object has no attribute 'get' "
body: <p>I am trying to convert English Date to equivalent Nepali date.</p>
  <p>When I run the code I get</p>
  <blockquote>
  <p>AttributeError: 'list' object has no attribute 'get'</p>
  </blockquote>
  <p>This is my code:</p>
  <pre><code>from datetime import date
  import datetime 
  import time
  import calendar
  
  engMonth = int(input('Enter birth month in A.D.'))
  engDate = int(input('Enter birth date in A.D.'))
  engYear = int(input('Enter birth year in A.D.'))
  </code></pre>
  <p>Below is a List of no. of days in each month  of each year within a valid range</p>
  <p>Nepali year-month List where, 2000, 2001, 2002 and so on are the Nepali years and 30, 32, 31 and so on are the total days in months</p>
  <pre><code>nepaliMonths = [
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],  #2000
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],  #2001
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],
              [ 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],  #2071
              [ 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],  #2072
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31 ],  #2073
              [ 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31 ],
              [ 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30 ],
              [ 31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 31, 32, 31, 32, 30, 31, 30, 30, 29, 30, 30, 30 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30 ],
              [ 30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],  #2090
              [ 31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30 ],
              [ 30, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 30, 30, 30, 30 ],
              [ 30, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30 ],
              [ 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30 ],
              [ 31, 31, 32, 31, 31, 31, 29, 30, 29, 30, 29, 31 ],
              [ 31, 31, 32, 31, 31, 31, 30, 29, 29, 30, 30, 30 ]   #2099
          ]
  
  
  #define the least possible English date 1944/01/01 Saturday.
  
  startingEngYear = 1944
  startingEngMonth = 1
  startingEngDay = 1
  dayOfWeek = calendar.SATURDAY  #1944 is a saturday
  
  
  #Let's define the equivalent Nepali date 2000/09/17.
  
  startingNepYear = 2000
  startingNepMonth = 9
  startingNepday = 17
  
  
  # Let's calculate the number of days between the two English dates as follows:
  
  date0=date(engYear,engMonth,engDate)
  date1=date(startingEngYear,startingEngMonth,startingEngDay)
  delta=date0 - date1
  # print (delta.days)
  
  
  #initialize required nepali date variables with starting  nepali date
  nepYear = startingNepYear
  nepMonth = startingNepMonth
  nepDay = startingNepday
  </code></pre>
  <p>Error is in this block of code.</p>
  <pre><code># decrement delta.days until its value becomes zero
  while delta.days != 0:
  
      # getting total number of days in month nepMonth in a year nepYear
      daysInMonth = nepaliMonths.get(nepYear)[nepMonth]
      nepDay+=1 # incrementing nepali day
  
      if(nepDay &gt; daysInMonth):
          nepMonth+=1
          nepDay = 1
  
      if(nepMonth &gt; 12):
          nepYear+=1
          nepMonth = 1
  
      dayOfWeek+=1 #counting the days in terms of 7 days
      if(dayOfWeek &gt; 7):
          dayOfWeek = 1
  
      delta.days-=1   
  </code></pre>
  <p>Help</p>