Python Learning Path Basics (III.)

Source: Internet
Author: User

A brief review of the last course content

Main content: Str|list|dict Class---objects

Specific content can be consulted:

Http://www.cnblogs.com/wupeiqi/articles/5433925.html
Http://www.cnblogs.com/wupeiqi/articles/5444685.html

Second, Python follow-up learning methods: First organize the course content to blog, and then write homework

Iii. contents of the course

1. Data type-set

Summary:
Differences between list and set set (small knowledge points):
List: ordered repeatable nested
Set set: unordered, non-repeating sequence


Introduction of Set Set:
Creation of lists

Method One: List ((+))
Method Two: List1 = (1,2,3,4)

Similarly, there are two ways to create a set set


The study of set set is mainly from two aspects.

1.1 How to create a collection set
Method One: s = {1,2,3,4}
Method Two: List1 = [1,2,3,4]
S1 = Set{list1}
Small knowledge Point: Empty collection S2 = {}
s = {1,2,3}print (S,type (s)) List1 = [1,2,3,4]S1 = set (list1) print (S1,type (s1)) S2 = set () print (S2,type (S2))

The results of the program run as follows:

{1, 2, 3} <class ' Set ' >{1, 2, 3, 4} <class ' Set ' >set () <class ' Set ' >

  

1.2 Operation set

  




2. Functions

1.1 Custom Functions
1.2 Built-in functions

3. File operation
3.1 Open File
3.2 Operating files
3.3 Closing files


Python Learning Path Basics (III.)

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.