Python3.6 full Stack Development example [019]

Source: Internet
Author: User

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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.