try to open &read msg from file ,print the error msg in casse of exception | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

try to open &read msg from file ,print the error msg in casse of exception

24th Oct 2016, 2:11 PM
ashwini salgar
ashwini salgar - avatar
1 Resposta
+ 1
try: f=open("filename.txt") a=f.read () print a except: print "Error" finally: f.close ()
1st Dec 2016, 12:07 PM
Binara Sachin