The Python: Learn python in just 2 days by Mercy 28

The Python: Learn python in just 2 days by Mercy 28

Author:Mercy 28 [28, Mercy]
Language: eng
Format: azw3, epub
Published: 2020-05-31T16:00:00+00:00


OOP Special Method:

We cannot use str, len, del methods directly in class. If we have to define that under or inside a class object, then we can use it normally.

*Try above code yourself. You may get correct output or some error but you have to figure it out. Your interest will be increased by that.

● Input/output with basic files in python

Python supports file handling and allows users to handle files i.e., to read and write files.

open(filename, mode) — To open a file in read and write mode. Open decide how files can be opened.

Modes:

“r” - read

“w” - write

“a” - append

“r+”, “w+”, “a+” - read and write

One thing to remember is that if we don’t provide mode in open function, then python assumes “r” by default.

myfile.read() method — To read the content of the file use this method.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.