-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patho11.py
More file actions
43 lines (37 loc) · 1.2 KB
/
o11.py
File metadata and controls
43 lines (37 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# f1=open("file_1.txt","r")#how to open a file
# # r mode is read mode which is read
# data=f1.read()
# print(data)
# #next is perform the write operation
# f1=open("file_1.txt","w")
# f1.write("I am Student who Studing a BE in RIT Hassan")
# #in the write operation we are over write the text in the file and new text is written
# #next we use a r+ mode which is helps to both read and write the file
# f1=open("file_1.txt","r+")
# print(f1.read())
# f1.write("this is python course ")
# f1=open("file_4.text","x")
#f1=open("file_4.text","r")
# f1=open("file_4.text","w")
# #data=f1.read()
# data=f1.write("Hai vscode i am deepak")
# print(data)
# f1=open("file_4.text","r+")
# print(f1.tell())
# f1.write("Hi")
# print(f1.tell())
# print(f1.read())
# print(f1.tell())
# # f1.write("I am from CKM")
# w+ Mode is that when the file is do not exists it will create a new file
# f1=open("file_6.txt","w+")
# # see 1st file_6 is not exists after it will create a new file and we can perform a operation
# f1.write("Hi")
# print(f1.tell())
# print(f1.read())
# print(f1.tell())
f1=open("file_4.text","a+")
print(f1.tell())
f1.write("i am good boy")
f1.seek(0)
print(f1.read())