months.py
months = open( “months.txt”, “w”)
months.write(“Jan\nFeb\nMar\nApr\nMay\nJun\nJul
\nAug\nSept\nOct\nNov\nDec”)
months.close()
fMonths=open(“months.txt”)
mon=fMonths.read()
while mon != “” :
print(mon)
mon = fMonths.read(1)
Output
Python programming examples – for beginners
Simple and easy to understand Python , R programming , Scala and Oracle examples for beginners
months.py
months = open( “months.txt”, “w”)
months.write(“Jan\nFeb\nMar\nApr\nMay\nJun\nJul
\nAug\nSept\nOct\nNov\nDec”)
months.close()
fMonths=open(“months.txt”)
mon=fMonths.read()
while mon != “” :
print(mon)
mon = fMonths.read(1)
Output
You must be logged in to post a comment.