Adobe Scan 02-Feb-2021
Adobe Scan 02-Feb-2021
Eating
1608-19-737-034
CREATED FILE NAMED DEMOFILE AND WRITTEN sOME CONTENT AND DISPLAYED IT:
content= f.readlines()
print(line)
OUTPUT:
data = f.readlines()
words = Iine.split()
print (words)
OUTPUT:
3 import os
if os.path.exists("create.txt"):
Os.remove("create.txt")
else:
OUTPUT:
RESTART:
C:/Users/91939/AppData/Local/Programs/Python/Python39/file 3.py ==
4 import os
with open
('create.txt','w') as p:
p.write'my first line of file\n')
P.write(just now created\n')
O
if os.path.exists("crfile.txt"):
os.remove("crfile.txt")
else
print("the file does not exist")
OUTPUT
5 with open('create.txt') as f:
with open('out.txt,w') as y:
for line in f:
y.write(line)
with open('out.txt',r) as y:
content=y.readlines()
for line in content:
print(line)
OUTPUT
1 import re
else
OUTPUT:
RED found
FINDING ALL THE WORDS NEEDED IN STATEMENT
2 import re
print(result)
OUTPUT:
l'one', 'one]