#Birdwatch program to count number of birds observed #Python starts counting array elements from 0, #so we'll add an extra element at the beginning and start from 1. birdName = [' ','robin','blackbird','pigeon','magpie','bluetit','thrush','wren','starling'] birdCount = [0,0,0,0,0,0,0,0,0] print ('Please input name of bird, x to end: ') bird = (input()) while bird !="x": birdFound = False count =1 while count in range (1,9)and birdFound==False: if bird == birdName[count]: birdFound = True print ('number observed: ') birdsObserved = int(input()) birdCount[count] = birdCount[count] + birdsObserved #endif count+=1 #endwhile if birdFound == False: print( 'Bird species not in array') print ('Please input name of bird: ') bird = (input()) #endwhile # all bird numbers input #now print out the totals for each bird for count in range (1,9): print (birdName[count], birdCount[count])