Showing posts with label user input in file handling in python. Show all posts
Showing posts with label user input in file handling in python. Show all posts

Thursday, 12 October 2017

Take user input data


print("Writing into file.....")
f1=open("file.txt","w")             //Opening a file in write  (existing or non-existing)
f1.read(input())                       //Taking user input to write into file
f1.close()                                //Closing file 
f1=open("file.txt","r")               //Opening file to read data
print(f1.read())                        //Reading data from file
f1.close()                               //Closing file

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]         ...