Skip to content

Commit

Permalink
Create ass11.4.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvojitss authored Oct 19, 2023
1 parent f41a9c9 commit a666fd5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ass11.4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
def fwrite(myname):
try:
f=open(myname,"w")
while True:
f.write(input("Write a line: "))
f.write("\n")
ch=input("Do u want to write again (y/n): ")
if ch=='n' or ch=='N':
break
f.close()
except IOError:
print("File can not be created")
return

fwrite("myname.txt")






#Write a line: my name is shuvojit
#Do u want to write again (y/n): n

0 comments on commit a666fd5

Please sign in to comment.