World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITian's, only for AI Learners.
Download our e-book of Introduction To Python
4 (4,001 Ratings)
a year ago
import sys randomList = ['a', 0, 2] for entry in randomList: try: print("The entry is", entry) r = 1/int(entry) break except: print("Oops!",sys.exc_info(),"occured.") print("Next entry.") print() print("The reciprocal of",entry,"is",r)
raise KeyboardInterrupt Traceback (most recent call last): ... KeyboardInterrupt
Chat now for any query