Showing posts with label writing into file in python. Show all posts
Showing posts with label writing into file in python. Show all posts

Thursday, 12 October 2017

Creating, Reading and Writing into File


print("Writing into file.....")
f1=open("File.txt","w")     //Opening and creating file into write mode
f1.write(input())                 //Writing into file
f1.close()
print("Reading from file.....")
f1=open("File.txt","r")               //Opening file in read mode
a=f1.read()                                 //Reading from file
print(a)
f1.close()

Python Program to find Fabonacci

fabtab={} def fabonacci(n):     fabtab[0]=0     fabtab[1]=1     for i in range(2,n+1):         fabtab[i]=fabtab[i-1]+fabtab[i-2]         ...