
open("file name", "mode of opening")

print('''

''')
print('''
open("forloop.txt", "r")
is for only open to read only
''')
open("forloop.txt", "r")
print('''

''')

print('''
open("forloop.txt", "w")
is for only open to write/ change file
''')

open("forloop.txt", "w")

print('''

''')
print('''
open("forloop.txt", "a")
is only for append at the end of the file not in the original

''')

open("forloop.txt", "a")

print('''

''')
print('''
open("forloop.txt", "r+")
is for rwading and writing
''')

open("forloop.txt", "r+")



print('''
forloop1122=open("forloop.txt", "r")
''')

forloop1122=open("forloop.txt", "r")

print('''
to check if that file is readable or not
print(forloop1122.readable())
if readable , will print true
''')

print(forloop1122.readable())

print('''
then to take out all info of the file
print(forloop1122.read())
''')

print(forloop1122.read())

print('''
then to read/print for each line
print(forloop1122.readlie())
''')
print(forloop1122.readlie())

print('''
then to read/print for 3 lines
print(forloop1122.readlie())
print(forloop1122.readlie())
print(forloop1122.readlie())
''')

print(forloop1122.readlie())
print(forloop1122.readlie())
print(forloop1122.readlie())


print(''' to open all line in list form

print(forloop1122.readlies())
''')
print(forloop1122.readlies())



print('''
to open specific or the 2nd line in list form
print(forloop1122.readlies()[1])
''')


print(forloop1122.readlies()[1])


print('''

''')

print('''

''')


print('''then should close the file by
forloop1122.close()''')

forloop1122.close()


print('''

''')

print('''

''')

print('''

''')

print('''

''')

