Python3.6 full Stack Development example [015]

Source: Internet
Author: User

15. Movie Voting: The program gives a list of several films that are currently being released. Voted by the user for each movie.
Finally, the user's voting information is published in LST = [' Beijing meets Seattle ', ' Save Mr. Wu ', ' American past ', ' the beautiful legend of Sicily ']
Result: {' Beijing meets Seattle ': 99, ' Save Mr. Wu ': 80, ' The American Past ': 6, ' The Beautiful Tales of Sicily ': 23}

LST = ['Beijing meets Seattle','Save Mr. Wu','The American past','the beautiful legends of Sicily']new=[]dic= Dict.fromkeys (lst,0)#{' Beijing meets Seattle ': 0, ' Save Mr. Wu ': 0, ' The American past ': 0, ' The beautiful Tales of Sicily ': 0} while1:     forI,jinchEnumerate (dic,1):        Print(I,j) New.append (j) Choice= Input ('Please enter a serial number or a movie name to vote'). Strip ()ifchoice.isdigit (): Choice=int (choice)Print(new[choice-1]) Dic[new[choice-1]] + = 1elifChoiceinchDic:dic[choice]+ = 1elifChoice.upper () = ='Q':        Print(DIC) Break    Else:        Print('The information you entered is wrong, please re-enter!')    Print(DIC)

Python3.6 full Stack Development example [015]

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.