Python - O - Pedia

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By HardCoderr
H
HardCoderr
Community Contributor
Quizzes Created: 2 | Total Attempts: 405
| Attempts: 139 | Questions: 60
Please wait...
Question 1 / 60
0 %
0/100
Score 0/100
1. What will be the output of the following Python code? class Truth:     pass x=Truth() bool(x)

Explanation

The code defines a class called Truth and creates an instance of it called x. The bool() function is then used to check the truthiness of x. In Python, any object that is not explicitly defined as False is considered True. Since x is an instance of the Truth class, it is not explicitly defined as False, so the bool(x) expression evaluates to True.

Submit
Please wait...
About This Quiz
Python - O - Pedia - Quiz

Python-o-Pedia is a focused quiz designed to assess knowledge of Python programming. It covers topics such as keywords, operators, data types, and specific language functions, making it ideal... see morefor learners seeking to enhance their Python skills. see less

2. What will be the output of the following Python code? if (9 < 0) and (0 < -9):     print("hello") elif (9 > 0) or False:     print("good") else:     print("bad")

Explanation

The output of the code will be "good". This is because the condition in the elif statement, (9 > 0) or False, evaluates to True. Therefore, the code inside the elif block will be executed, which prints "good".

Submit
3.  Which of the following is not a keyword?

Explanation

The keyword "eval" is used in Python to evaluate a string as a Python expression. It is not a keyword because it can be used as a variable name or a function name without any syntax error. Keywords in Python have predefined meanings and cannot be used as identifiers. On the other hand, "assert", "nonlocal", and "pass" are all keywords in Python. "assert" is used for debugging and testing purposes, "nonlocal" is used to declare a nonlocal variable, and "pass" is used as a placeholder for empty blocks of code.

Submit
4. What will be the output of the following Python code? i = 1 while True:     if i%2 == 0:         break     print(i)     i += 2

Explanation

The code starts with initializing the variable i to 1. It then enters a while loop that runs indefinitely (due to the condition True). Inside the loop, it checks if i is divisible by 2. If it is, the break statement is executed, causing the loop to terminate. If i is not divisible by 2, it prints the value of i and then increments i by 2. This process continues until the break statement is executed. Therefore, the output of the code will be a sequence of odd numbers: 1 3 5 7 9 11.

Submit
5. What will be the output of the following Python code? x = ['ab', 'cd'] for i in x:     i.upper() print(x)

Explanation

The output of the given Python code will be ['ab', 'cd']. This is because the code iterates over each element in the list x, but does not modify the elements in any way. The method i.upper() returns a new string with all the characters in i converted to uppercase, but it does not change the original string. Therefore, when the print statement is executed, it will display the original list x without any modifications.

Submit
6. What will be the output of the following Python code? x = "abcdef" while i in x:     print(i, end=" ")

Explanation

The code will throw an error because the variable "i" is not defined before using it in the while loop.

Submit
7. What type of inheritance is illustrated in the following Python code? class A():     pass class B(A):     pass class C(B):     pass

Explanation

The given Python code illustrates multi-level inheritance. In multi-level inheritance, a class inherits from another class, which in turn inherits from another class. In this code, class B inherits from class A, and class C inherits from class B. This creates a multi-level inheritance hierarchy.

Submit
8. What does single-level inheritance mean?

Explanation

Single-level inheritance refers to a scenario where a subclass is derived from a single superclass. In this type of inheritance, there is a direct one-to-one relationship between the subclass and the superclass. The subclass inherits all the properties and behaviors of the superclass, allowing it to extend or modify them as needed. However, there is no involvement of multiple base classes or multiple subclasses in this type of inheritance.

Submit
9. What type of data is: a=[(1,1),(2,4),(3,9)]?

Explanation

The given data, a=[(1,1),(2,4),(3,9)], is a list of tuples. Each tuple within the list represents a pair of values, where the first value is the x-coordinate and the second value is the y-coordinate. The list allows for multiple tuples to be stored together, creating a collection of data points.

Submit
10. What will be the output of the following Python code?
>>> a=(0,1,2,3,4)
>>> b=slice(0,2)
>>> a[b]

Explanation

The given code is creating a tuple named 'a' with the values (0, 1, 2, 3, 4). Then, it defines a slice object 'b' with a start index of 0 and stop index of 2. Finally, it uses the slice object 'b' to slice the tuple 'a'. Since the slice object 'b' represents the range from index 0 to index 2 (excluding index 2), the output will be a new tuple containing the values (0, 1).

Submit
11. What will be the output of the following Python code? x = "abcdef" i = "a" while i in x[:-1]:     print(i, end = " ")

Explanation

The code initializes a variable "x" with the string "abcdef" and another variable "i" with the string "a". It then enters a while loop that checks if "i" is in the substring of "x" excluding the last character. Since "i" is always present in the substring "abcde" in each iteration, the loop continues to execute. Inside the loop, it prints the value of "i" followed by a space. This process continues until "i" is no longer in the substring. Therefore, the output will be a series of "a" separated by spaces.

Submit
12. What will be the output of the following Python code? d = {0: 'a', 1: 'b', 2: 'c'} for x in d.values():     print(d[x])

Explanation

not-available-via-ai

Submit
13. What will be the output of the following Python code? ⦁    class father: ⦁        def __init__(self, param): ⦁            self.o1 = param ⦁      ⦁    class child(father): ⦁        def __init__(self, param): ⦁            self.o2 = param ⦁      ⦁    >>>obj = child(22) ⦁    >>>print "%d %d" % (obj.o1, obj.o2)

Explanation

The output of the code will be "error is generated" because the child class does not have an __init__ method, so when the child object is created and the print statement tries to access obj.o1 and obj.o2, it will result in an AttributeError.

Submit
14.  What will be the output of the following Python code? ⦁    >>>example = "snow world" ⦁    >>>print("%s" % example[4:7])

Explanation

The code is using string slicing to extract a portion of the "example" string. The slicing is done from index 4 to 7 (exclusive), so it will include the characters at index 4, 5, and 6. Therefore, the output will be "wo".

Submit
15. Which of these is not a core data type?

Explanation

The correct answer is "class". In programming, a class is not considered a core data type. Core data types are fundamental data types that are built into the programming language and are used to represent basic values. Examples of core data types include lists, dictionaries, and tuples. However, a class is a user-defined data type that allows the programmer to create their own data structures and define their own methods and attributes.

Submit
16. What will be the output of the following Python code snippet? print('a@ 1,'.islower())

Explanation

The given Python code snippet is checking whether the string "a@ 1," is in lowercase or not. The islower() function returns True if all characters in the string are lowercase, and False otherwise. In this case, the string contains the lowercase letter 'a', so the output will be True.

Submit
17. What will be the output of the following Python code snippet? print('HelloWorld'.istitle())

Explanation

The output of the given code snippet will be False because the string "HelloWorld" is not in title case. The istitle() method checks if each word in the string starts with an uppercase letter and the remaining letters are lowercase. In this case, "HelloWorld" does not meet this condition, so the method returns False.

Submit
18. What will be the output of the following Python Code?     1.>>>str="hello"     2.>>>str[:2]     3.>>>

Explanation

The code is creating a variable named "str" and assigning it the value "hello". Then, it is using slicing to extract the characters from index 0 to index 1 (excluding index 2) from the string. This will result in the output "he".

Submit
19. Suppose list1 is [2445,133,12454,123], what is max(list1)?

Explanation

The correct answer is 12454 because it is the largest number in the given list.

Submit
20. What is the return type of function id?

Explanation

The return type of the function "id" is int.

Submit
21. What error occurs when you execute the following Python code snippet? apple=mango

Explanation

The error that occurs when executing the given Python code snippet is a NameError. This error is thrown when a variable is used before it is defined or assigned a value. In this case, the variable "mango" is not defined or assigned a value, so trying to assign it to the variable "apple" results in a NameError.

Submit
22. What datatype is the object below? L=[1, 23, "Hello" , 2]

Explanation

The object "L" is a list because it is enclosed in square brackets and contains a sequence of different data types, including integers, strings, and possibly other objects. Lists are a type of data structure in Python that can hold multiple values and allow for indexing and manipulation of its elements.

Submit
23. Which one of these is floor division?

Explanation

The double forward slash operator (//) is the floor division operator. Floor division returns the largest integer that is less than or equal to the division of two numbers. It is used to divide two numbers and discard the decimal part, giving the result as an integer. For example, 9 // 2 would return 4, as it discards the decimal part of 4.5.

Submit
24. Which data type use key-value pair?

Explanation

A dictionary data type uses key-value pairs. In a dictionary, each value is associated with a unique key, allowing for efficient retrieval and manipulation of data. Unlike lists, arrays, and tuples, dictionaries provide a way to store and access data based on a specific identifier or key, rather than by position or index. This makes dictionaries useful for tasks such as storing and retrieving data in a structured and organized manner.

Submit
25. Which of the following is not a complex number?

Explanation

The given expression k=2+3I represents a complex number. The imaginary unit i is typically used to represent the square root of -1 in mathematics, but in some contexts, the letter I or J is used instead. Therefore, k=2+3I is a valid complex number.

Submit
26. What will be the output of the following Python code? class A:     def test(self):         print("test of A called") class B(A):     def test(self):         print("test of B called")         super().test()   class C(A):     def test(self):         print("test of C called")         super().test() class D(B,C):     def test2(self):         print("test of D called")       obj=D() obj.test()

Explanation

The code defines four classes: A, B, C, and D. Class A has a method called test that prints "test of A called". Class B inherits from A and overrides the test method to print "test of B called". Class C also inherits from A and overrides the test method to print "test of C called". Class D inherits from both B and C and has its own method called test2 that prints "test of D called".

When the code creates an object of class D and calls the test method on it, it first calls the test method of class B, which prints "test of B called". Then, it calls the test method of class C, which prints "test of C called". Finally, it calls the test method of class A, which prints "test of A called".

Therefore, the output of the code will be:
test of B called
test of C called
test of A called

Submit
27. Operators with the same precedence are evaluated in which manner:

Explanation

Operators with the same precedence are evaluated from left to right. This means that when there are multiple operators with the same precedence in an expression, the one on the left will be evaluated first, followed by the one on the right.

Submit
28. What does ~4 evaluate to?

Explanation

The "~" operator in many programming languages is a bitwise negation operator. When applied to a number, it flips all the bits in its binary representation. In this case, "~4" would flip all the bits in the binary representation of 4, resulting in a binary number with all bits set to 1 except for the sign bit. In two's complement representation, this binary number represents -5. Therefore, "~4" evaluates to -5.

Submit
29. Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

Explanation

The correct syntax for slicing operation in Python is to use the colon (:) symbol to specify the start and end indices of the slice. The first option, `print(list1[0])`, selects only the element at index 0 of the list. The second option, `print(list1[:2])`, selects the elements from index 0 to index 1. The third option, `print(list1[:-2])`, selects all elements except the last two elements. Therefore, all of the mentioned options correctly demonstrate the syntax for slicing operation.

Submit
30.  Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?

Explanation

After executing the code listExample.pop(1), the element at index 1 in listExample is removed. Therefore, the resulting list list1 will be [3, 5, 20, 5, 25, 1, 3].

Submit
31. Which of these definitions correctly describes a module?

Explanation

A module is a defined and implemented functionality that is designed to be incorporated into a program. It is a self-contained unit that can be reused in different programs. It is not just any program that reuses code, but rather a specific functionality that is designed and implemented to be used as a part of a larger program. The other options mentioned, such as denoting by triple quotes or defining the specification of how it is to be used, do not accurately describe the concept of a module.

Submit
32. Which of the following operators has its associativity from right to left?

Explanation

The operator that has its associativity from right to left is the exponentiation operator (**). This means that when there are multiple occurrences of this operator in an expression, the evaluation starts from the rightmost occurrence and moves towards the left. For example, in the expression 2 ** 3 ** 2, the rightmost exponentiation operation (3 ** 2) is evaluated first, resulting in 9. Then, the expression becomes 2 ** 9, which equals 512.

Submit
33. What will be the output of the following Python code? ⦁    >>>list1 = [1, 3] ⦁    >>>list2 = list1 ⦁    >>>list1[0] = 4 ⦁    >>>print(list2)

Explanation

The output of the code will be [4, 3]. This is because when we assign `list2` to `list1`, it creates a reference to the same list object. Therefore, any changes made to `list1` will also be reflected in `list2`. In this case, we are changing the first element of `list1` to 4, so when we print `list2`, it will show the updated value [4, 3].

Submit
34. What will be the output of the following Python code? #mod1 def change(a):     b=[x*2 for x in a]     print(b) #mod2 def change(a):     b=[x*x for x in a]     print(b) from mod1 import change from mod2 import change #main s=[1,2,3] change(s)

Explanation

The given code imports two functions named "change" from two different modules, mod1 and mod2. Both functions have the same name, but they perform different operations on the input list. When the code calls the "change" function with the list [1,2,3], it will first execute the "change" function from mod1, which doubles each element in the list and prints [2,4,6]. Then, it will try to execute the "change" function from mod2, which squares each element in the list and prints [1,4,9]. However, there is a name clash because both functions have the same name. Therefore, the code will raise an error and the output will be "There is a name clash".

Submit
35.  What will be the output of the following Python code? a=[1,2,3] b=a.append(4) print(a) print(b)

Explanation

The output of the code will be [1, 2, 3, 4] and None. The append() method modifies the original list by adding the element to the end of it. So, when we print(a), it will display [1, 2, 3, 4]. However, the append() method does not return anything, so when we print(b), it will display None.

Submit
36. What will be the output of the following Python code? s=["pune", "mumbai", "delhi"] [(w.upper(), len(w)) for w in s]

Explanation

The code snippet is using a list comprehension to iterate over the elements in the list 's'. For each element, it is converting the element to uppercase using the 'upper()' method and finding the length of the element using the 'len()' function. The output is a list of tuples, where each tuple contains the uppercase version of the element and its length. Therefore, the correct answer is [(‘PUNE’, 4), (‘MUMBAI’, 6), (‘DELHI’, 5)].

Submit
37. _____ represents an entity in the real world with its identity and behaviour.

Explanation

An object represents an entity in the real world with its identity and behavior. Objects are instances of a class, which defines their properties and methods. Each object has its own unique identity and can perform actions or exhibit behavior based on its defined methods. Objects encapsulate data and functionality, allowing them to interact with other objects and manipulate their own state. Therefore, an object is the most appropriate choice to represent an entity in the real world with its identity and behavior.

Submit
38. Which of the following is a Python tuple?

Explanation

The correct answer is (1, 2, 3) because it is enclosed in parentheses, which is the syntax for creating a tuple in Python. A tuple is an ordered collection of elements and is immutable, meaning its values cannot be changed once it is created. The other options are not tuples: [1, 2, 3] is a list, {1, 2, 3} is a set, and {} is an empty dictionary.

Submit
39. What will be the output of the following Python code? class test:      def __init__(self,a="Hello World"):          self.a=a        def display(self):          print(self.a) obj=test() obj.display()

Explanation

The correct answer is "Hello World" is displayed. In the given code, a class named "test" is defined with an initializer method "__init__" that takes a default argument "a" with a value of "Hello World". The initializer method sets the instance variable "self.a" to the value of the argument. The class also has a method named "display" which simply prints the value of "self.a". An object "obj" of the "test" class is created without passing any arguments, so the default value "Hello World" is assigned to "self.a". Finally, the "display" method is called on the "obj" object, which prints "Hello World" as the output.

Submit
40. Suppose d = {"john":40, "peter":45}, to delete the entry for "john" what command do we use?

Explanation

The correct command to delete the entry for "john" in the dictionary is "del d['john']". This command uses the "del" keyword followed by the name of the dictionary "d" and the key "john" enclosed in square brackets. By using this command, the entry for "john" will be removed from the dictionary "d".

Submit
41. Suppose d = {"john":40, "peter":45}. To obtain the number of entries in dictionary which command do we use?

Explanation

The correct answer is len(d). In Python, the len() function is used to obtain the number of entries in a dictionary. By passing the dictionary name as an argument to len(), it returns the length of the dictionary, which represents the number of key-value pairs present in it. Therefore, len(d) is the appropriate command to use in order to obtain the number of entries in the dictionary d.

Submit
42. What will be the output of the following Python code snippet? 1. d={"john":40 , "peter":45} 2. print(list(d.keys()))

Explanation

The code snippet creates a dictionary 'd' with two key-value pairs. The 'keys()' method is then used to retrieve a list of all the keys in the dictionary. The 'print' statement outputs the list of keys, which is ['john', 'peter'].

Submit
43. What will be the output of the following Python code? >>> a={'B':5,'A':9,'C':7} >>> sorted(a)

Explanation

The output of the code will be ['A', 'B', 'C']. The sorted() function in Python returns a new list containing all items from the original list in ascending order. In this case, the original list is the keys of the dictionary 'a', which are 'B', 'A', and 'C'. When sorted, they will be arranged in alphabetical order, resulting in ['A', 'B', 'C'].

Submit
44.  What will be the output of the following Python code? >>> a={"a":1,"b":2,"c":3} >>> b=dict(zip(a.values(),a.keys())) >>> b

Explanation

The code first creates a dictionary 'a' with keys 'a', 'b', and 'c' and their corresponding values 1, 2, and 3. Then, it uses the zip() function to swap the keys and values of dictionary 'a' and creates a new dictionary 'b'. Finally, it prints the dictionary 'b', which will have the keys and values swapped from dictionary 'a'. So, the output will be {1: 'a', 2: 'b', 3: 'c'}.

Submit
45. The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.

Explanation

The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same because both expressions follow the order of operations. In both cases, the parentheses are evaluated first, resulting in (2-1) equaling 1. Then, the division operation is performed, resulting in 4/3 equaling 1.3333. Finally, the multiplication operation is performed, resulting in 1.3333*(2-1) equaling 1.3333. Therefore, the value of both expressions is the same, which makes the answer True.

Submit
46. What will be the output of the following Python expression? round(4.5676,2)?

Explanation

The round() function in Python is used to round a number to a specified number of decimal places. In this case, the expression round(4.5676,2) will round the number 4.5676 to 2 decimal places. Since the third decimal place is 7, which is greater than or equal to 5, the number will be rounded up to 4.57. Therefore, the output of the expression will be 4.57.

Submit
47. What is the value of the following expression? float (22//3+3/3)

Explanation

The expression evaluates to 8.0 because the division operator (/) performs floating-point division, and the result of 3/3 is 1.0. The floor division operator (//) performs integer division, and the result of 22//3 is 7. Adding these two results together gives 8.0.

Submit
48. What is Instantiation in terms of OOP terminology?

Explanation

Instantiation in terms of OOP terminology refers to the process of creating an instance of a class. In object-oriented programming, a class acts as a blueprint for creating objects. When an instance of a class is created, it means that a new object is created based on the class definition. This allows the object to have its own set of properties and methods defined by the class. Therefore, the correct answer is "Creating an instance of class".

Submit
49. Which of the following expressions is an example of type conversion?

Explanation

The expression "4.0+float(3)" is an example of type conversion because it involves converting the integer value 3 into a float value using the float() function. The float() function is used to convert a value into a floating-point number, and in this case, it converts the integer 3 into the float 3.0. The addition operation then takes place between the float value 4.0 and the float value 3.0.

Submit
50. To open a file c:\scores.txt for reading, we use _____________

Explanation

The correct answer is "infile = open(“c:\\scores.txt”, “r”)". This is the correct way to open a file "c:\scores.txt" for reading in Python. The double backslashes "\\" are used to escape the special meaning of the backslash character "\" in Python strings. The "r" parameter specifies that the file should be opened in read mode.

Submit
51. What will be the output of the following Python code? class A():     def disp(self):         print("A disp()") class B(A):     pass obj = B() obj.disp()

Explanation

The output of the given Python code will be "A disp()". This is because the code defines a class A with a method disp(), and then defines a class B that inherits from class A. The object "obj" is created as an instance of class B, and then the disp() method is called on this object. Since class B does not have its own disp() method, it inherits the disp() method from class A, resulting in the output "A disp()".

Submit
52. Which keyword is used for function?

Explanation

The keyword "def" is used for defining a function in Python. It is followed by the function name and a pair of parentheses, which can include parameters if any. The "def" keyword is essential for creating reusable blocks of code that can be called and executed multiple times throughout a program.

Submit
53. What will be the output of the following code snippet? bool('False') bool()

Explanation

The code snippet is checking the boolean value of the string 'False' and an empty boolean value. In Python, any non-empty string is considered as True, so 'False' will be evaluated as True. On the other hand, an empty boolean value is considered as False. Therefore, the output of the code snippet will be True for the first statement and False for the second statement.

Submit
54. What will be the output of the following Python code? ⦁    def printMax(a, b): ⦁        if a > b: ⦁            print(a, 'is maximum') ⦁        elif a == b: ⦁            print(a, 'is equal to', b) ⦁        else: ⦁            print(b, 'is maximum') ⦁    printMax(3, 4)

Explanation

The output of the code will be "4 is maximum" because the function printMax is called with arguments 3 and 4. Since 4 is greater than 3, the if condition "a > b" is true and the code inside that block is executed, which prints "4 is maximum".

Submit
55. All keywords in Python are in

Explanation

In Python, keywords are reserved words that have predefined meanings and cannot be used as variable names. The keywords in Python are written in lowercase, not in uppercase or capitalized. Therefore, the correct answer is "None of the mentioned".

Submit
56. What will be the output of the following Python code? ⦁    x = 50 ⦁    def func(): ⦁        global x ⦁        print('x is', x) ⦁        x = 2 ⦁        print('Changed global x to', x) ⦁    func() ⦁    print('Value of x is', x)

Explanation

The code first assigns the value 50 to the variable x. Then, the function func is defined and the global keyword is used to indicate that the variable x inside the function is the same as the global variable x. Inside the function, the value of x is printed, which is 50. Then, the value of x is changed to 2 and printed again. Finally, outside the function, the value of x is printed again, which is 2. Therefore, the output of the code will be "x is 50", "Changed global x to 2", and "Value of x is 2".

Submit
57. Python supports the creation of anonymous functions at runtime, using a construct called __________

Explanation

Python supports the creation of anonymous functions at runtime using a construct called "lambda". The lambda keyword allows us to create small, one-line functions without a name. These functions are commonly used in situations where we need a simple function for a short period of time and don't want to define a separate function using the "def" keyword. The lambda functions are often used in combination with built-in functions like map(), filter(), and reduce().

Submit
58. The readlines() method returns ____________

Explanation

The readlines() method is used to read all the lines from a file and return them as a list. Therefore, the correct answer is "a list of lines". This means that each line of the file will be an element in the list, allowing for easy manipulation and access to individual lines.

Submit
59.  What will be the output of the following Python code? a=10 b=20 def change():     global b     a=45     b=56 change() print(a) print(b)

Explanation

The code first assigns the values 10 and 20 to variables a and b, respectively. Then, the function change is defined, which modifies the global variable b to have a value of 56. Inside the function, a local variable a is also defined and assigned a value of 45, but since it is not declared as global, it does not affect the value of the global variable a. After calling the change function, the values of a and b are printed. The value of a remains 10 because the local variable a inside the function does not affect the global variable a. The value of b is 56 because it was modified inside the function using the global keyword.

Submit
60. What will be the output of the following Python code? def foo(i, x=[]):     x.append(i)     return x for i in range(3):     print(foo(i))

Explanation

The code defines a function called "foo" that takes two arguments, "i" and "x". The default value for "x" is an empty list. Inside the function, the value of "i" is appended to the list "x". The function then returns the updated list.

In the main code, a loop is used to iterate through the range of numbers from 0 to 2. Each iteration, the "foo" function is called with the current number as the argument. The returned list is then printed.

The output of the code will be:
[0]
[0, 1]
[0, 1, 2]

This is because the default value of "x" is a mutable object (a list), and it is created only once when the function is defined. Therefore, each time the function is called without explicitly passing a value for "x", the same list is used and the value of "i" is appended to it.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 15, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 15, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 06, 2019
    Quiz Created by
    HardCoderr
Cancel
  • All
    All (60)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
 Which of the following is not a keyword?
What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
What type of inheritance is illustrated in the following Python code? ...
What does single-level inheritance mean?
What type of data is: a=[(1,1),(2,4),(3,9)]?
What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
 What will be the output of the following Python code? ...
Which of these is not a core data type?
What will be the output of the following Python code snippet? ...
What will be the output of the following Python code snippet? ...
What will be the output of the following Python Code? ...
Suppose list1 is [2445,133,12454,123], what is max(list1)?
What is the return type of function id?
What error occurs when you execute the following Python code snippet? ...
What datatype is the object below? L=[1, 23, "Hello" , 2]
Which one of these is floor division?
Which data type use key-value pair?
Which of the following is not a complex number?
What will be the output of the following Python code? ...
Operators with the same precedence are evaluated in which manner:
What does ~4 evaluate to?
Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is...
 Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1...
Which of these definitions correctly describes a module?
Which of the following operators has its associativity from right to...
What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
 What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
_____ represents an entity in the real world with its identity and...
Which of the following is a Python tuple?
What will be the output of the following Python code? ...
Suppose d = {"john":40, "peter":45}, to delete the entry for "john"...
Suppose d = {"john":40, "peter":45}. To obtain the number of entries...
What will be the output of the following Python code snippet? ...
What will be the output of the following Python code? ...
 What will be the output of the following Python code? ...
The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.
What will be the output of the following Python expression? ...
What is the value of the following expression? float (22//3+3/3)
What is Instantiation in terms of OOP terminology?
Which of the following expressions is an example of type conversion?
To open a file c:\scores.txt for reading, we use _____________
What will be the output of the following Python code? ...
Which keyword is used for function?
What will be the output of the following code snippet? ...
What will be the output of the following Python code? ...
All keywords in Python are in
What will be the output of the following Python code? ...
Python supports the creation of anonymous functions at runtime, using...
The readlines() method returns ____________
 What will be the output of the following Python code? ...
What will be the output of the following Python code? ...
Alert!

Advertisement