Programming Prutor Python Quiz 8 by Techarge September 14, 2022 written by Techarge 0 comment Use these online Prutor Python Quiz as a fun way for you to check your learning progress and to test your skills. Welcome to your Prutor Python Quiz 8 In python, a class is created by keyword, and to create of the class, we will have to use constructor of class. a) def, file b) class, object c) self, .py file d) None of these What will be the output of the following python code? class Roll: def init(self, id): self.id = id id = 231 return idval = Roll(321)print (val.id) a) TypeError b) 231 c) 321 d) None of these What will be the output of following python code? class X: def init(self): self.a = 10 self._b = 20 self.b = 20 def getB(self): return self.bx = X()x._b = 60print(x.getB()) a) 20 b) 60 c) Error d) Program runs but does not print anything Private method in python starts with _____ while protected methods starts with _________. a) #, @ b) double underscore, single underscore c) single underscore,double underscore d) None of these What will be the output of the following code. Code is saved in a file named 'code.py' : f = open('file.txt') f.readlines() print(f.name) print ( f.closed ) f.close() print ( f.closed ) a) Error b) code.py False True c) code.py True False d) file.txt False True Time's up Have you found this platform useful ? Don't forget to share with your love one's ! PYTHON TUTORIAL JAVA TUTORIAL Learn PythonPrutor Python QuizPython Quiz Share 4 FacebookTwitterLinkedinRedditWhatsappTelegramEmail Techarge previous post Prutor Python Quiz 7 next post Prutor Python Quiz 9 You may also like Extracting a piece of String in python Python Roadmap 2022 Easy ways to convert an XML file into JSON Format Program to find the diagonal sum of a matrix Difference between Web Server and Web Application Difference between Web Browser and Web Server Installing and Configuring WAMP Server on Localhost Difference between Native Apps and Web Apps Requirement Analysis Prutor Python Quiz 10