learning python fifth edition

Discover learning python fifth edition, include the articles, news, trends, analysis and practical advice about learning python fifth edition on alibabacloud.com

Python Full Stack Learning summary four: file operations

preservation.f.closed# If the file is closed, returns truef.encoding# viewing the encoding format of open files using the, note that not the actual encoding format of the fileF.tell #查看文件处理当前的光标位置F.seek (3) #从头开始运算, move the cursor to the third byteF.truncate #从头开始运算, files are kept only from 0-10 bytes of content, and the file must be opened in writing, except for ' W ' and ' w+ '.6 advanced application of the Seek methodSeek a total of 2 parameters, the first parameter is the number of cursor

Python Learning Notes (ii) List operations

follows:1nums=[1,2,3,4,5,6,2,3,4,6,4,3,2,1,2,3,4]2 Print(Nums[3:6])#[4,5,6]3 Print(Nums[:6])#[1,2,3,4,5,6] If the previous value of the slice is not written, the number from the beginning4 Print(nums[3:])#[4,5,6,2,3,4,6,4,3,2,1,2,3,4] If the subsequent value of the slice is not written, take the end5 Print(nums[:])#if the two values of a slice are not written, take it from the beginning to the end6 Print(Nums[::2])#step is 2, this represents all the elements, and then every 2 elements take a7 P

Total Pages: 9 1 .... 5 6 7 8 9 Go to: Go

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.