what should line 155 and 156 say?
117 print (AverageAdulLupului 118 19 #Though wait... If you...
117 print (AverageAdulLupului 118 19 #Though wait... If you look at AdultTotal and Number of Species, the calculation 20 #should be 114/9....That's not 12! It's 12 and two thirds! (or 12.66666666... 121 #The problem is that python automatically interprets whole numbers as integers 122 #Try and see the difference between the below examples 123 print( 3/5) 124 print(3.0/5) 125 #If you put a decimal in the number, python knows that the numbers aren't just 126 #whole integers and won't round off as much. We can force python to do the sam 127 #thing using the float() function. 128 print{ float(3)/5) 129 130 #Let's rewrite our average calculation to get the correct value 131 Adult Pop - aninal data l'Adult Population') #Get the list of adult populations 132 AdultTotal - Sun (Adult Pop) #Sum adds together all the numbers in a list 133 NmberOfSpecies = len(AdultPop) len says how many items (species here) are in 134 AverageAdult Population - float(AdultTotal) /NumberOf Species calculate an avera 135 print("The average adult population for all 200 species is really!' 136 print (AverageAdult Population) 137 138 139 ************************************************************* ****** 140 UK. You should now be able to play around a little with all the parts of this 141 #small dataset. Let's practice by doing two things: get the average child 142 **population for all species and then the total number of animals in the zoo, 143 #including both adults and babies. 144 145 #Let's get the average child population for all species. Copy the code above an 146 #make a couple small changes to get the child values 147 ChildPop = animal_data['ChildPopulation'] 148 ChildTotal = sum(ChildPop) 149 NumberOfSpecies = len(ChildPop) 150 AverageChildPopulation > float(ChildTotal) /NumberOfSpecies 151 print("The average child population for all zoo species is :') 152 print (AverageChildPopulation) 153 154 Great! Now let's find the total zoo population. FELL in code below to do that. 156 Total Population = sum(ChildTotal, Adult Total) 157 print('The total zoo population (adult and child) is:') 158 print (Total Population) 159 160 161 Now that you've Figure out those wives Save this in 162 155 Permissions: R