Python Study Notes (1)

Source: Internet
Author: User

>>> Names = ["jack", 24, 'Rose ', 22, ['name', 'age'] # define a list
>>> Isinstance (names, list) # determine if names belongs to the list type
True
# Exit the interpreter with quit () in Python
Alt + P # previous Code
Alt + N # Next code
Dir (_ builtins _) # built-in functions, built-in Function
# If you forget a bif tab, many tips will be given.
>>> Import OS # import standard library OS
>>> OS. getcwd () # obtain the current working directory
'C: \ python33'
>>> OS. chdir ("D: \ code \") # Switch the Directory
>>> Data‑open('1.txt ') ← open the 1.txt File
>>> Print (data. readline (), end = '') # Read a row in the file using the readline () method
And then print it on the screen.
Life Is Short, Use Python!
>>> Print (data. readlin, end = '') # Read a row in the file using the readline () method
And then print it to www.2cto.com on the screen.
The osc is about to become another cnbeta!
>>> Data. seek (0) # Use the seek () method to return to the start position of the file
0
>>> For each_line in data:
Print (each_line, end = '')
# Output file content by falling
The osc is about to become another cnbeta!
Life is short-you need Python!
Because of the new work, I have been studying the python language for several consecutive days.
I also read many articles about python in China and abroad.
As I have learned more about python over the past few days, I feel that learning python is really "too pressing ".
".
>>> Data. close () # close the file
>>>

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.