The day3 of Python learning

Source: Internet
Author: User

1. Dictionary operation

1   for  in dic:                          # loop A dictionary 2      print  key,dic.get (key)3 for in    dic.items ():4      print  k,v

2. Collection

1 #-*-coding:utf-8-*-2 3S1 ={"a","b","C","D"}4S2 ={"a","b","F"}5 PrintS1.difference (S1)#calculate two different parts of a set6 PrintS1.intersection (S1)#intersection7 PrintS1.issubset (S2)#determine if S1 is a subset of S28 PrintS1.issuperset (S2)#determine if S1 is the parent set of S29 #

3. Character encoding

4. File operation

The day3 of Python learning

Related Article

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.