Python 9.21 Jobs

Source: Internet
Author: User

1. List instance: Create a Job scoring list by string, make and delete to query statistic traversal operation. For example, query the first 3 points subscript, statistics 1 points of the number of students, 3 points of the number of students and so on.

>>> Can=list ('1123232323123')>>>can['1','1','2','3','2','3','2','3','2','3','1','2','3']>>> Can.append (4)>>>can['1','1','2','3','2','3','2','3','2','3','1','2','3', 4]>>> Can.insert (1,'5')>>>can['1','5','1','2','3','2','3','2','3','2','3','1','2','3', 4]>>> Can.pop (1)'5'>>>can['1','1','2','3','2','3','2','3','2','3','1','2','3', 4]>>> Can.index ('3')3>>> Can.count ('1')3>>> Can.count ('3')5

2. Dictionary: Establish the student's academic grade dictionary, do the deletion and change to check the traversal operation.

>>> dic=dict (Zip (['1','2','3'],[92,94,96]))>>>dic{'1': 92,'2': 94,'3': 96}>>> dic1={4:'98'}>>>dic.update (DIC1)>>>dic{'1': 92,'2': 94,'3': 96, 4:'98'}>>> Dic.pop (4)'98'>>>dic{'1': 92,'2': 94,'3': 96}>>> dic[4]=100>>>dic{'1': 92,'2': 94,'3': 96, 4:100}>>> Dic.get ('1')92

3 A list, a tuple, a dictionary, a collection of traversal. Summary lists, tuples, dictionaries, collections of connections and differences.

4 Examples of English word frequency statistics

A string to parse

b Decomposition to extract words

A Case txt.lower ()

B delimiter '.,:;?! -_

' C-Count dictionary

D Sort List.sort ()

E output Top (Ten)

Python 9.21 Jobs

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.