19. Kill the host. The following information on the host revenue, as required, to complete the appropriate operation:
(1) Calculate the average return value of the anchor
sum = 0 for in zhubo.values (): + =Iprint(round (Sum/len ( Zhubo)))
(2) to kill the host with less than average income
dic1={} # Create an empty dictionary to store people less than the average for i,j in zhubo.items (): # loop anchor dictionary if j<round (Sum/len (Zhubo)): # below the mean condition dic1[i]=j # People below the mean are added to the dictionary dic1 for J in dic1: # loop new dictionary del ZHUBO[J] # Delete information for old dictionaries print (Zhubo) # print the deleted Zhubo dictionary
(3) Kill Lubenwei
Zhubo = {" Lubenwei " "Feng Ti mo " " Babul hair "" King boss ": 4500}del zhubo[" Lubenwei " ]print(Zhubo)
Python3.6 full Stack Development example [019]