a) except b) else c) finally d) assert
Gkbix Latest Questions
a) ValueError b) TypeError c) ImportError d) IOError
a) an object b) a special function c) a standard module d) a module
a) True b) False
a) NameError b) IOError c) AssignmentError d) ValueError
a) The standard exceptions are automatically imported into Python programs b) All raised standard exceptions must be handled in Python c) When there is a deviation from the rules of a programming language, a semantic error is thrown
Print(“Good Morning”) print(“Good night) a) Syntax, Syntax b) Semantic, Syntax c) Semantic, Semantic d) Syntax, Semantic
valid = False while not valid: try: n=int(input("Enter a number")) while n%2==0: ...
def getMonth(m): if m<1 or m>12: raise ValueError("Invalid") print(m) getMonth(6) a) ValueError b) Invalid c) 6 d) ValueError(“Invalid”)
CODE 1 import math num=int(input("Enter a number of whose factorial you want to find")) print(math.factorial(num)) CODE 2 num=int(input("Enter a number of whose factorial you want to find")) print(math.factorial(num)) a) ValueError, NameError b) AttributeError, ValueError c) NameError, TypeError d) TypeError, ValueError