PYCHARM QUIZ DESCRIPTION Total Questions −30 00 Max Time − 15:00 In PyCharm, which of the following functions can help us to find the version of python that we are currently working on? sys.version(1) sys.version(0) sys.version() sys.version What will be the output of the following Python code snippet if x=1 in PyCharm? x<<2 4 2 1 8 What will be the output of the following Python code in Pycharm? class tester: def __init__(self, id): self.id = str(id) id="2 12 224 None Error What will be the output of the following Python expression in PyCharm? round(4.576) 4 4.6 5 4.5 In PyCharm, which one of the following is the use of function in python? Functions don’t provide better modularity for your application you can’t also create your own functions Functions are reusable pieces of programs All of the mentioned In PyCharm, what will be the output of the following Python expression if x=56.236? print("%.2f"%x) 56.236 56.23 56.0000 56.24 In PyCharm, which of the following statements is used to create an empty set in Python? ( ) [ ] { } set() Which function is called when the following Python program is executed inPyCharm? f = foo() format(f) str() format() __str__() __format__() Which of these is the definition for packages in PyCharm? A set of main modules A folder of python modules A number of files containing Python definitions and statements A set of programs making use of Python modules What are the two main types of functions in PyCharm? System function Custom function Built-in function & User defined function User function In PyCharm, which of the following is a Python tuple? {1, 2, 3} {} [1, 2, 3] (1, 2, 3) Which of the following character is used to give single-line comments in PyCharm? // # ! /* To add a new element to a list we use which Python command in PyCharm? list1.addEnd(5) list1.addLast(5) list1.append(5) list1.add(5) Which of the following is used to define a block of Python code in PyCharm? Indentation Key Brackets All of the mentioned What is the maximum possible length of an identifier in PyCharm? 79 characters 31 characters 63 characters none of the mentioned What will be the output of the following Python code in PyCharm? l=[1, 0, 2, 0, 'hello', '', []] list(filter(bool, l)) [1, 0, 2, ‘hello’, ”, []] Error [1, 2, ‘hello’] [1, 0, 2, 0, ‘hello’, ”, []] What will be the output of the following Python code in Pycharm? class tester: def __init__(self, id): self.id = str(id) id="224" temp = tester(12) print(temp.id) 12 224 None Error What does pip stand for in PyCharm? unlimited length all private members must have leading and trailing underscores Preferred Installer Program none of the mentioned PyCharm supports the creation of anonymous functions at runtime, using a construct called __________ pi anonymous lambda none of the mentioned What will be the output of the following Python function if the random module has already been imported in PyCharm? random.randint(3.5,7) Error Any integer between 3.5 and 7, including 7 Any integer between 3.5 and 7, excluding 7 The integer closest to the mean of 3.5 and 7 What will be the output of the following Python code in PyCharm? x = 'abcd' for i in x: print(i.upper()) a B C D a b c d error A B C D What will be the output of the following Python code in PyCharm? print("Hello {0[0]} and {0[1]}".format(('foo', 'bin'))) Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’) Error Hello foo and bin None of the mentioned In PyCharm which keyword is used for function in Python language? Function Def Fun Define In PyCharm, what will be the output of the following Python function, assuming that the random module has already been imported? random.uniform(3,4) Error Either 3 or 4 Any integer other than 3 and 4 Any decimal value between 3 and 4 Which of the following is the use of id() function in PyCharm? Every object doesn’t have a unique id Id returns the identity of the object All of the mentioned None of the mentioned In PyCharm, what is the interval of the value generated by the function random.random(), assuming that the random module has already been imported? (0,1) (0,1] [0,1] [0,1) What is the order of namespaces in which PyCharm looks for an identifier? Python first searches the built-in namespace, then the global namespace and finally the local namespace Python first searches the built-in namespace, then the local namespace and finally the global namespace Python first searches the local namespace, then the global namespace and finally the built-in namespace Python first searches the global namespace, then the local namespace and finally the built-in namespace Which of the following functions is a built-in function in PyCharm? factorial() print() seed() sqrt() In PyCharm will the expression shown below results in an error. print("-%5d0",989) True false What will be the output of the following Python code in PyCharm? import random random.choice([10.4, 56.99, 76]) Error Either 10.4, 56.99 or 76 Any number other than 10.4, 56.99 and 76 56.99 only Previous Next Total Question16 Wrong Answer13 Right Answer13