Delete()
#example
f=open("D:/[Link]","r")
for x in f:
print (x)
-----------------------
output:
this is a appending operation in file
conti...
#delete a file
import os
[Link]("D:/[Link]")
various access modes
Mode purpose
r default mode
rb binary format
r+ reading and writing
rb+ reading and writing in binary
format
write()
mode purpose
w only for writing
wb binary format for writing
only
w+ read and write
wb+ binary format for read and
write
append()
mode purpose
a appending
ab binary format
a+ reading and append
ab+ binary format reading
and appending
Classes and objects
Python is an object-oriented programming language
Everything in Python is an object, with its properties
and methods
Class definition
class ClassName: //'Optional class documentation string' class_suite
list the difference Procedural and
Object Oriented Programming
Definition
Security
Method
Division of Program
Movement of Data
Approach
Inheritance
Reusability of Code
oops concepts
class
object
abstraction
encapsultaion
inheritance
polymorphism
blue print which followed by objects.
logical structure with behavior
object:
instance of class
class
attributes
functions
class is logical structure object is physical entity
XYZ
student
roll_no roll
name name
write branch
read read()
write()(