EMRS PGT Computer Science 2023 Question Paper

  1. Which of the following is an invalid method/function in Python dictionary?
    1. get( )
    2. pop( )
    3. popitem( )
    4. remove( )
      • Answer: Option – 4
      • remove( ) – This method does not exist for Python dictionaries. To delete a key-value pair, you should use the del keyword or the pop() method.
  2. Select the correct output for the following python code.
    for I in range (6, 1, -2):
    print(end = ‘*$$’)
    1. *&&*&&*&&
    2. *&& *&&
    3. *&&*&&
    4. *&& *&& *&&
      • Answer: Option – 1
      • The output is: *&&*&&*&&
        Explanation:
        The provided code uses a for loop with the range() function and a special argument in the print() function:
        1. The range(6, 1, -2) Function
        The range() function is called with three arguments: startstop, and step:
        start = 6
        stop = 1
        step = -2 (This means the loop will count backward).
        The loop will start at 6 and decrement by 2 in each iteration, continuing as long as the value is greater than the stop value (1).
        The values of i will be:
        6 (First iteration)
        4 (Second iteration: 6−2=4)
        2 (Third iteration: 4−2=2)
        The next value would be 2−2=0, which is less than the stop value of 1, so the loop terminates.
        Therefore, the loop executes 3 times.
        2. The print(end = '&&') Function
        In each of the three iterations, the print() function is called with no content to print, but with the end parameter set to '*&&'.
        The end parameter specifies what to print after the content (which is nothing in this case). By default, end is '\n' (a newline character). By setting end = '*&&', the string *&& is printed after each call, and no newline is printed.
        Iteration.
  3. For the following Python statement
    Txt = list(‘PEACE’)
    What shall be the output of print(Txt)?
    1. Error in statement
    2. [‘PEACE’]
    3. [‘P’,’E’,’A’,’C’,’E’]
    4. [P,E,A,C,E]
      • Answer: Option – 3
      • Explanation:
        The statement $\text{Txt} = \text{list(‘PEACE’)}$ uses the built-in list() function to convert the string 'PEACE' into a list.
        A Python string is an iterable sequence of characters. When the list() function is applied to an iterable like a string, it creates a new list containing each individual item from the iterable. In this case, the string is broken down into its five constituent characters, with each character becoming a separate string element in the list $\text{Txt}$:
  4. For the following Python statement
    Msg = (‘Good Day’)
    What shall be the data type of Msg ?
    1. Error in statement
    2. string
    3. tuple
    4. list
      • Answer: Option – 3
      • Explanation:
        Parentheses for Grouping: In Python, when you use parentheses () around a single value, they simply act as a grouping operator and do not define a tuple.
      • Tuple Definition: To create a tuple, you must include a comma inside the parentheses, even if it contains only one item (a trailing comma).
        • String: ('Good Day') is a string.
        • Tuple: ('Good Day',) would be a tuple.
        • Tuple (Multiple Items): ('Good', 'Day') is a tuple.
      • Since the statement assigns the single string 'Good Day' enclosed in grouping parentheses to the variable Msg, the variable’s data type is str (string). You can verify this using the type() function: type(Msg) would return <class 'str'>.
  5. Which of the following will not run the loop statement an infinite number of times in Python ?
    1. while True :
      print(“ALWAYS”)
    2. while 1%1 :
      print(“ALWAYS”)
    3. while 21%2 :
      print(“ALWAYS”)
    4. while 21//2:
      print(“ALWAYS”)
      • Answer: Option – 3
      • Explanation:
        • while True:: Infinite loop by definition.
        • while 1 % 1:: $1 \pmod 1 = 0$. Since $0$ is false, the loop condition is immediately False. The loop never runs.
        • while 21 % 2:: $21 \pmod 2 = 1$. Since $1$ is true, the loop condition is always True. Infinite loop.
        • while 21 // 2:: $21 // 2 = 10$. Since $10$ is true, the loop condition is always True. Infinite loop.
  6. Given the following assignment of a variable
    LS = [1,9,2,8,3,7,5,4]
    What will be the output of the following ?
    print(LS[::2]+LS[::-2]
    1. [4,7,8,9,1,2,3,5]
    2. [9,8,7,4,5,3,2,1]
    3. [5,3,2,1,9,8,7,4]
    4. [1,2,3,5,4,7,8,9]
      • Answer: Option – 4
      • Explanation:
        The expression is $\text{print}(\text{LS}[::2] + \text{LS}[:: -2])$. This involves two list slices and a list concatenation.
        1. First Slice: $\text{LS}[::2]$ (Step of 2)
      • This slice starts at the beginning (default start), goes to the end (default end), and takes every second element (step of 2).
        $$\text{LS}[::2] = [1, 2, 3, 5]$$
        2. Second Slice: $\text{LS}[:: -2]$ (Negative Step of -2)
      • This slice starts at the beginning (default start, which is the last element when the step is negative), goes to the end (default end, which is the first element), and takes every second element in reverse (step of -2).
        $$\text{LS}[:: -2] = [4, 7, 8, 9]$$
      • 3. Concatenation: $\text{LS}[::2] + \text{LS}[:: -2]$
        The two resulting lists are joined together:
        $$[1, 2, 3, 5] + [4, 7, 8, 9] = [1, 2, 3, 5, 4, 7, 8, 9]$$
  7. Which of the following is the correct syntax for panda’s dataframe ?
    1. pandas.dataFrame(data, index, dtype, cpy)
    2. pandas.DataFrame(data, index, dtype, cpy)
    3. pandas.DataFrame(data, index, col, dtype, cpy)
    4. pandas.DataFrame(data, index, row, dtype, cpy)
      • Answer: Option – 3
      • Explanation:
        The correct syntax for creating a pandas DataFrame is pandas.DataFrame(data, index, col, dtype, cpy).
  8. Which of the following options is true in Python ?
    1. Logical errors can be handled using try. . . except
    2. Syntex errors can be handled using try. . . except
    3. Execution/Runtime errors can be handled using try. . . except
    4. No erros can handled using try. . .except
      • Answer: Option – 3
  9. Which out of the following module is required to be used to create a binary file in Python ?
    1. binfile
    2. Binary
    3. bin
    4. pickle
      • Answer: Option – 4
      • Explanation:
        pickle (Correct): This is a standard Python module used for serialization and de-serialization of Python object structures. Serializing an object (like a list or dictionary) into a file means converting it into a byte stream, which is stored in a binary file (often given a .pkl extension). When reading, the process is reversed (de-serialization).
        • To write an object to a binary file: pickle.dump(data, file_object).
        • You still open the file in binary write mode: open('filename.pkl', 'wb').
  10. A dictionary is declare as
    D = {10 : ‘A’, 25 : ‘B’, 32 : ‘C’, 54 : ‘D’}
    Which of the following is incorrect ?
    1. D[32] += ‘*’
    2. D[‘X’] = 100
    3. D[20] = ‘E’
    4. D[30] += 20
      • Answer: Option – 4
      • Explanation:
        $D[30] += 20$
      • This is incorrect. This operation is interpreted as $D[30] = D[30] + 20$.
  11. What will the following code result in ?
    import pandas as pd
    pd.Series([10,20], index = [‘A’,’B’,’C’]
    1. IndexError
    2. SyntaxError
    3. ValueError
    4. NameError
      • Answer: Option – 3
      • Explanation:
        The length of the data must match the length of the index. Since the lengths are different ($2 \neq 3$), pandas raises a ValueError with a message similar to “Length of values does not match length of index.”
        The data list is [10, 20], which has a length of 2.
        The index list is ['A', 'B', 'C'], which has a length of 3.
  12. What is the output of the following ?
    import pandas as pd
    S1 = pd.Series ([100,200,300])
    print(S1)
    1. 1 100
      2 200
      3 300
      dtype: float64
    2. 0 100
      1 200
      2 300
      dtype: int64
    3. 1 100
      2 200
      3 300
      dtype: int64
    4. 0 100
      1 200
      2 300
      dtype: float64
      • Answer: Option – 2
      • Explanation:
        S1 = pd.Series([100, 200, 300]) – This creates a pandas Series named S1. A pandas Series is a one-dimensional labeled array. Since no index argument is provided, pandas automatically creates a default integer index starting from 0.
        print(S1): This displays the Series. The output structure shows:
        • The Index on the left (0, 1, 2).
        • The Data (Values) on the right (100, 200, 300).
        • The Data Type (dtype) at the bottom. Since the input values are integers, the default data type is int64.
  13. Consider the following Python code and answer the question givne below :
    with open(“NOTES.TXT”,”r”) as F :
    Line = F.readlines( )
    ______________# Statement 1
    which of the follwing Python statement will find and display the number of lines present in the file “NOTES. TXT”?
    1. print(LINE.count(‘\n’))
    2. print(LINE.len())
    3. print(len(LINE))
    4. print(LINE.count())
      • Answer: Option – 3
      • Explanation:
        The function F.readlines() reads all the lines from the file object $F$ and returns them as a list of strings. Each element in this list is one line from the file. The built-in Python function len() returns the number of items in a container (like a list). Since Line is a list of lines, len(LINE) correctly gives the total number of lines.
  14. Which method out of the following is used to write a line of content in a CSV file in a Python program ?
    1. write
    2. writeline
    3. writer
    4. writerow
      • Answer: Option – 4
  15. Which method out of the following will allow the read operation from a Binary file in a Python program ?
    1. accept
    2. load
    3. read
    4. input
      • Answer: Option – 3
  16. Which of the following method is used to move the file pointer to read the content from a specific position in a text file inside a Python program ?
    1. find
    2. seek
    3. move
    4. tell
      • Answer: Option – 2
  17. Which out of the following mode is required to be used while opening a binary file to allow read as well as write operations in a Python program ?
    1. r+
    2. rb+
    3. ab
    4. wb
      • Answer: Option – 2
      • Explanation:
        The combination rb+ opens the binary file for both reading and writing, with the file pointer initially positioned at the beginning of the file.
  18. Obseve the following flowchart and find the output.

    FLOW CHART
    1. 100
    2. 160
    3. 180
    4. 120
      • Answer: Option – 3
  19. The Boolean expression (A.B)’ is equivalent to :
    1. A . B’
    2. A’ + B’
    3. A’ . B’
    4. A + B’
      • Answer: Option – 2
      • Explanation: by demorgan’s law
  20. Which of the following memory is non-volatile ?
    1. ROM and Cache
    2. RAM
    3. ROM
    4. Cache
      • Answer: Option – 3
      • Explanation: Non-volatile memory retains the stored information even when the device’s power is turned off.
  21. Which is the Linux ?
    1. Windows based Application Software
    2. Proprietary Operating System
    3. Open-source Operating System
    4. Open-source Application Software
      • Answer: Option – 3
      • Explanation: Open-source is the key characteristic of Linux. It means the source code is freely available to anyone. Users can view, modify, and redistribute the code under licenses like the GNU General Public License (GPL).
  22. if ⊕ represents XOR Gate in Boolean algebra and A⊕B = C, then B⊕C equals to :
    1. A’
    2. 0
    3. 1
    4. A
      • Answer: Option – 4
  23. What is an interpreter ?
    1. A program that converts a program into machine code line by line as the program is run.
    2. A program that writes instructions to perform.
    3. A program that converts machine language to high-level language.
    4. A program that converts whole of a program code into machine language in one step.
      • Answer: Option – 1
  24. Identify the Boolean expression from the given options, which is equivalent to the Logic Circuit Diagram.
    CIRCUIT DIAGRAM EMRS PGT QUESTION
    1. A + B’.C’ + D
    2. (A.B’ + C’).D
    3. (A + B’).C’ + D
    4. A.B’ + C’.D
      • Answer: Option – 3
  25. Identify the Boolean Gate, which represents the following truth table :
    EMRS PGT QUESTIONS
    1. NAND
    2. OR
    3. XOR
    4. NOR
      • Answer: Option – 1
  26. What is the updated version of the IT Act, 2000 called?
    1. Advanced IT Act, 2007
    2. IT Act, 2007
    3. IT Act, 2007
    4. Advanced IT Act, 2000
  27. Octal equivalent of the Binary number (10110)2 is:
    1. 62
    2. 16
    3. 26
    4. 52
      • Answer: Option – 3
  28. Binary equivalent of the decimal number (11)10 is :
    1. 1111
    2. 1011
    3. 1101
    4. 1001
      • Answer: Option – 2
  29. Intellectual Property Rights (IPR) protect the use of information and ideas that are of :
    1. Commercial value
    2. Ethical value
    3. Traditional value
    4. Historical value
      • Answer: Option – 3
  30. In Boolean algebra, A.(A+B) is logically equivalent to :
    1. A + B
    2. A
    3. B
    4. A.B
      • Answer: Option – 2
      • Explanation:
        The equivalence $$\text{A} \cdot (\text{A} + \text{B}) = \text{A}$$ is known as the Absorption Law in Boolean algebra.
  31. The decimal representation for the character ‘a’ (lower A) in ASCII is ________
    1. 122
    2. 65
    3. 90
    4. 97
      • Answer: Option – 4
  32. Decimal equivalent of the hexadecimal number (ADD)16 is :
    1. 2187
    2. 2781
    3. 2871
    4. 2178
      • Answer: Option – 2
  33. Considering the following dictionary :
    Num = {10 : ‘Ten’, 100: ‘Hundred’, 10 : ‘Decimal’}
    What shall be the output of print(Num) ?
    1. {10 : ‘Decimal’, 100: ‘Hundred’}
    2. Error
    3. {10 : ‘Ten’, 100: ‘Hundred’,10 : ‘Decimal’}
    4. {10 : ‘Ten’, 100: ‘Hundred’}
      • Answer: Option – 1
      • Explanation:
        When you define a dictionary literal with the same key multiple times, the later occurrence of the key-value pair overwrites the earlier ones.
        The first pair is 10 : 'Ten'.
        The second pair is 100 : 'Hundred'.
        The third pair is 10 : 'Decimal'. This pair overwrites the value 'Ten' associated with the key 10.
        The final dictionary stored in memory is:
      • $$Num = \{10: \text{‘Decimal’}, 100: \text{‘Hundred’}\}$$
  34. What minimum and the maximum values will be generated from the following python statement ?
    print (random.randrange(100)+1)
    1. 1 and 99
    2. 0 and 99
    3. 1 and 100
    4. 0 and 100
      • Answer: Option – 3
      • Explanation:
        The range of possible values is $0, 1, 2, \dots, 99$. But we have added +1, so minimum will be 0+1 = 1, maximum is 99+1 = 100.
  35. Identify the term, which is an unauthorized real-time interception, or monitoring of private communication between two entities over network.
    1. Snooping
    2. Cyberstalking
    3. Eavesdropping
    4. Phishing
      • Answer: Option – 3
      • Explanation:
        Eavesdropping (also known as sniffing or wiretapping) is the unauthorized, real-time interception and monitoring of private communication passing between two communicating entities over a network.
  36. Identify the Logical Operator used in Python out of the following.
    1. <=
    2. +=
    3. and
    4. in
      • Answer: Option – 3
  37. Which of the following Function Headers in a Python code will result in error ?
    1. def Compu(X = 100, Y = 100, Z = 1) :
    2. def Compu(X, Y = 10, Z = 1) :
    3. def Compu(X = 100, Y = 10, Z ) :
    4. def Compu(X, Y, Z = 1) :
      • Answer: Option – 3
      • Explanation:
        In Python, parameters with default values (called default arguments) must be placed after all parameters without default values (called positional arguments). This is known as the non-default argument follows default argument rule.
        def Compu(X = 100, Y = 10, Z):
        • The positional argument (Z) is placed after the default arguments (X and Y). This violates the rule and will raise a SyntaxError.
  38. Which of the following cannot be used as a valid identifier in Python ?
    1. Name_1
    2. FirstName
    3. 1stName
    4. Name1
      • Answer: Option – 3
      • Explanation:
        Explanation of Python Identifier Rules
        • Python has strict rules for defining identifiers (names for variables, functions, classes, etc.):
        • Must Start with a Letter or Underscore: An identifier must begin with a letter (A-Z, a-z) or an underscore (_).
        • Cannot Start with a Digit: An identifier cannot begin with a number (0-9).
        • Allowed Characters: After the first character, the identifier can contain letters, numbers, and underscores.
        • Case Sensitive: Python is case-sensitive (Name is different from name).
        • No Keywords: An identifier cannot be a reserved keyword (e.g., for, if, while).
      • Since 1stName begins with a digit, Python will raise a SyntaxError
  39. Choose the best option to fill the blank correctly.
    A ________________ is a human-friendly text form of the IP address.
    1. Memory address
    2. URL
    3. domain name
    4. MAC address
      • Answer: Option – 3
  40. XML is designed to ________ and ________ data. Select the beast pair of answers from the following options.
    1. store, transport
    2. format, design
    3. design, transport
    4. store, design
      • Answer: Option – 1
  41. Identify the communication protocol, which establishes and dedicated and direct connection between two communiting devices. This protocol defines how to devices with authenticate each other and establish a direct link between them to exchange the data.
    1. TELNET
    2. FTP
    3. PPP
    4. SMTP
      • Answer: Option – 3
      • Explanation:
        PPP (Point-to-Point Protocol): A data link layer (Layer 2) communication protocol used to establish a direct connection between two nodes. It’s widely used in broadband communications (like DSL) and for dial-up access.
  42. Using join, which of the follwoing MySQL query is almost equivalent to :
    SELECT NAME, MARKS FROM STUDENT, RESULT WHERE STUDENT.ROLL = RESULT.ROLL;
    1. SELECT NAME, MARKS FORM STUDENT NATURAL JOIN RESULT;
    2. SELECT NAME, MARKS FROM STUDENT, RESULT;
    3. SELECT NAME, MARKS FROM STUDENT JOIN RESULT;
    4. SELECT NAME, MARKS FROM STUDENT EQUI JOIN RESULT;
      • Answer: Option – 1
      • Explanation: The NATURAL JOIN keyword is a type of INNER JOIN that automatically joins the two tables based on all columns with the same name in both tables.
  43. Which datatype is mostly returned by fetchall( ) method in Python – MySQL connectivitiy ?
    Select the most common answer.
    1. A list of dictionaries or an empty list, if no more rows are available.
    2. A single tuples or an empty tuple, if no more rows are available.
    3. A single list or an empty list, If no more rows are available.
    4. A list of tuples are an empty list, If no more rows are available.
      • Answer: Option – 4
      • Explanation –
        When using Python’s fetchall() method with a MySQL connector like mysql-connector-python or PyMySQL, it typically returns: A list of tuples, where each tuple represents a row from the result set. If there are no rows, it returns an empty list. This behavior is consistent across most DB-API compliant libraries in Python.
  44. Which type of cable has high bandwidth supports high data transfer rate, signals can travel longer distances and electromagnetic noise cannot affect the cable, However expensive. Identify the transmission media.
    1. Twisted pair cable.
    2. Cat6 cable.
    3. Coaxial cable.
    4. Optical fiber.
      • Answer: Option – 4
      • Explanation –
        High Data Transfer Rate: They support very fast data transmission, ideal for internet backbones and high-speed networks.
      • Long Distance Transmission: Signals in optical fibers can travel much longer distances without significant loss, thanks to low attenuation.
      • Immunity to Electromagnetic Interference: Since optical fibers transmit data using light rather than electrical signals, they are not affected by electromagnetic noise.
  45. Select the correct full form of the term ARPANET from the given options.
    1. Advanced Research Programs Academic Network
    2. Advanced Research Project Agency Network.
    3. American Research Projects Advanced Network.
    4. American Research Programs Advanced Network.
      • Answer: Option – 2
  46. Identify the topology from the given options, which is a hierarchical topology in which there are multiple branches, and each branch can have one or more basic topologies, and are usually connect multiple LANs.
    1. Start topology.
    2. Mesh topology.
    3. Bus topology.
    4. Tree topology.
      • Answer: Option – 4
      • Explanation –
        Hierarchical structure: Tree topology is explicitly designed to represent a hierarchy, with a root node branching out to multiple levels.
  47. Identify the term from the given options, which is a small file or data packet stored by a website on the client’s computer and used by the websites to store browsing information of the user.
    1. Spyware.
    2. Trojan.
    3. Firewall.
    4. Cookies.
      • Answer: Option – 4
      • Explanation –
        Cookies are small files or data packets that websites store on a user’s computer. They’re primarily used to:
        • Remember user preferences (like language or theme settings)
        • Track browsing activity (for analytics or personalized ads)
        • Maintain session information (like keeping you logged in)
  48. GPRS is basically standard barrier of.
    1. 4G technology
    2. 2G technology.
    3. 2.5G technology.
    4. 3G technology.
      • Answer: Option – 3
      • Explanation-
        GPRS (General Packet Radio Service) is considered a 2.5G mobile communication technology. It was introduced as an enhancement to 2G GSM networks, enabling packet-switched data services like mobile internet and MMS. While 2G focused primarily on voice, GPRS allowed for always-on data connectivity, paving the way for more advanced services before the arrival of 3G
  49. Which computer hardware device used to convert data from a digital format into a format suitable for an analog transmission medium? Select the best answer out of the given options.
    1. Repeater
    2. Hub.
    3. Modem
    4. Switch.
      • Answer: Option – 3
  50. Identify the switching technique in which the message is sent in one go, but it is divided into smaller pieces, and they are sent individually. The pieces are given a unique number and adresses to identify their order at the receiving end.
    1. Binary switching
    2. Circuit switching
    3. Message switching
    4. Packet switching
      • Answer: Option – 4
      • Explanation –
        Packet switching is a technique used in computer networks where:
        • The entire message is divided into smaller units called packets.
        • Each packet is sent individually, possibly taking different routes to the destination.
        • Packets are labeled with sequence numbers and destination addresses so they can be reassembled in the correct order at the receiving end.
  51. As per NEP 2020 from which class will vocational education be introduced?
    1. Class 9
    2. Class 6.
    3. Class 7.
    4. Class 8.
      • Answer: Option – 2
  52. Ms Monica wants to introduce the topic on ‘Nutrition’ to her class three students. She should :
    1. Ask the students to open their tiffin boxes, see the contents and discuss their advantages and disadvantages.
    2. Draw the diagram of the digestive system on the blackboard.
    3. Use chart showing different kinds of foods and their advantages.
    4. Give examples of different foods rich in nutrients and their advantages.
      • Answer: Option – 1
  53. The best method to teach the concept of the ‘germination of a seed’ is to :
    1. Make students plant seeds and observe germination.
    2. Show pictures of seed growth.
    3. Provide detailed explanations.
    4. Draw pictures on the board and give descriptions.
      • Answer: Option – 1
  54. Which approach of learning out of the following, engages participants in activity, leads them to reflect on the activity critically and obtain useful insight and learning?
    1. Observation.
    2. Experiential learning.
    3. Collaboration.
    4. Passive learning.
      • Answer: Option – 2
  55. Which of the following components of pre-service teacher education program has granted scope for experiential learning?
    1. Critical reading based on great thinkers work.
    2. Internship through school attachment.
    3. Pedagogy courses through use of critical thinking.
    4. Foundation courses through critical exposure.
      • Answer: Option – 2
  56. A school organizes an educational trip for middle school students to Jim Corbett National Park. What would be the teachers advisory to the children during the visit?
    1. Observe keenly make note and share observations with other fellow students and teachers.
    2. Enjoy the trip along with fellow students.
    3. Observe everything without asking questions about it.
    4. Note down their doubts and ask the questions after reaching back.
      • Answer: Option – 1
  57. What is the full form of ABC as per the NEP 2020 ?
    1. Academic Bank of Credit.
    2. Assessment Book of Certificates.
    3. Assessment Book of Credits.
    4. Academic Bank of Certificates.
      • Answer: Option – 1
  58. What are the classes which cover at secondary stage according to NEP 2020 curriculum structure?
    1. Class 9 to 10
    2. Class 6 to 9
    3. Class 9 to 12
    4. Class 6 to 8
      • Answer: Option – 3
  59. Which course will be discontinued as per National Education Policy 2020?
    1. Ph.D.
    2. Ed.D.
    3. M.Ed.
    4. M.Phil.
      • Answer: Option – 4
  60. As per NEP 2020, students’ holistic multidimensional progress card will be redesigned in which of the following format?
    1. Comprehensive progress card.
    2. Tabular progress card.
    3. Continuous progress card.
    4. 360-degree progress card.
      • Answer: Option – 4
  61. Out of the following expressions, which one will not find the result as Xraised to the power Y?
    1. math.pow(X,Y)
    2. X**Y
    3. pow(X,Y)
    4. power(X,Y)
      • Answer: Option – 4
  62. Which out of the following is considered as a membership operator in python ?
    1. not
    2. is
    3. in
    4. or
      • Answer: Option – 3
      • Explanation:
        The in and not in operators in Python are used to test for membership (i.e., whether a value is present in a sequence like a list, tuple, or string).
  63. Which of the following is correct precedence of operators in Python?
    1. not, Braces, or, and
    2. Braces, not, and, or
    3. Braces, or ,and, not
    4. not, Braces, and, or
      • Answer: Option – 3
  64. Which string method out of the following will always break the string into 3parts in Python.
    1. mid
    2. split
    3. break
    4. partiton
      • Answer: Option – 4
  65. Consider the following assignment for a List L.
    L = [10, 20, 30, 40, 50, 60]
    Which print statement option will display the content in the following way?
    L = [60, 10, 20, 30, 40, 50]
    1. print(L[len(L)-1] + L[l : len(L)])
    2. print(L[-1], L[1 : ])
    3. print(l[-1] + L[1:])
    4. print(L[-1] + L[:len(L)-1])
      • Answer: Option – 3
  66. What is the output of the following?
    import numpy as np
    A = np.array([[2,3],[10,20]])
    print(A+1)
    1. [ [ 2 3 ] ]
      [11 21 ] ]
    2. [ [ 3 3]
      [11 20 ] ]
    3. [ [ 3 4]
      [10 20] ]
    4. [ [ 3 4 ]
      [11 21] ]
      • Answer: Option – 4
  67. What will the following code result in?
    import numpy as np
    A = np.array([12,23])
    B = np.array([10,20])
    print(A – B)
    1. [ [ 10 20]
      [ 12 23] ]
    2. [ 2 3]
    3. [-2 -3]
    4. [ [ 12 23]
      [10 20] ]
      • Answer: Option – 2
  68. What is the default color for matplotlib plots?
    1. Black.
    2. Red.
    3. Blue.
    4. Green.
      • Answer: Option – 3
      • Explanation:
        Matplotlib uses a default color cycle (specifically the Tableau ‘tab10’ palette) to assign colors to different plot elements (like lines or bars) in sequence.
      • The first color in this cycle, used for the initial plot element when no color is specified, is a shade of blue (hex code: #1f77b4).
  69. Which module is required to be imported in a Python program to use mean, median and mode methods?
    1. standard
    2. math
    3. stats
    4. statistics
      • Answer: Option – 4
      • Explanation:
        The statistics module is a part of Python’s standard library, meaning you don’t need to install it separately; you just need to import it.
      • It provides functions for calculating common mathematical statistics of numeric data. The key functions it includes are:
      • statistics.mean(): Calculates the arithmetic mean (average) of a data set.
      • statistics.median(): Calculates the median (the middle value) of a data set.
      • statistics.mode(): Calculates the mode (the most frequently occurring value) of a data set.
  70. Which of the following is false about global variables in Python?
    1. global keyboard is a must for first time of assignment of a global variable.
    2. global variables can be accessed anywhere in the program.
    3. global immutable variables require global keyword inside function.
    4. global mutable variables don’t require global keyword inside function.
      • Answer: Option – 4
      • Explanation:
        The global keyword is not required for the first assignment of a global variable if that assignment happens outside of any function.
  71. What is the purpose of legend( ) function in matplotlib ?
    1. To label different lines or markers on a plot.
    2. To label the X and Y axis of a plot.
    3. To add a title to a plot.
    4. To add annotations to a plot.
      • Answer: Option – 1
      • Explanation:
        The legend() function displays a small box on the plot that acts as a key to identify different datasets or series shown. It links the visual representation (color, line style, marker) of a line or set of markers to its corresponding label.
  72. Observe the following graph and find the missing statement in the Python code.
    import matplotlib.pyplot as pl
    _____________________
    pl.show( )
    LINE DIAGRAM
    1. pl.plot( [5, 2, 3, 1] )
    2. pl.line( [5, 2, 3, 1] )
    3. pl.bar( [5, 2, 3, 1] )
    4. pl.scatter( [5, 2, 3, 1] )
      • Answer: Option – 1
      • Explanation:
        The image shows a line graph (a series of points connected by straight line segments), which is typically generated in Matplotlib using the plot() function.
  73. The number of attributes in a relation is called the __________of relation.
    1. Cardinality.
    2. Tuples.
    3. Degree.
    4. Domain.
      • Answer: Option – 3
      • Explanation:
        • Degree: The number of attributes (columns) in a relation (table).
        • Cardinality: The number of tuples (rows) in a relation (table).
        • Tuple: A single row in a relation, representing a set of related data values.
        • Domain: The set of possible values for an attribute.
  74. Find the number of rows and columns of Cartesian product of two tables If the number of rows and columns of the first table is 2 and 3 respectively, and the number of rows and columns of the second table is 4 and 5 respectively.
    1. Number of rows = 8 & Number of columns = 15
    2. Number of rows = 6 & Number of columns = 15
    3. Number of rows = 8 & Number of columns = 8
    4. Number of rows = 6 & Number of columns = 8
      • Answer: Option – 3
      • Explanation:
        • The correct answer is: Number of rows = 8 & Number of columns = 8
          Cartesian Product ($R \times S$) – The Cartesian Product (or Cross Join) combines every row from the first table ($R$) with every row from the second table ($S$).
  75. Identify the key, which is a column (or attribute) or a group of columns in a table in RDBMS that is used to unique identify the rows of data in that table.
    1. Candidate key
    2. Primary key
    3. Alternate key
    4. Foreign key
      • Answer: Option – 2
      • Explanation:
        • The key that is a column (or attribute) or a group of columns in a table in an RDBMS that is used to uniquely identify the rows of data in that table is the Primary key.
          Key Types in RDBMS
          Primary key
          A specific Candidate Key chosen by the database designer to uniquely identify each row (tuple) in a table. It cannot contain null values.
          Candidate key
          Any attribute or set of attributes that can potentially serve as the primary key. They must be unique and non-reducible (minimal).
          Alternate key
          All Candidate Keys that were not chosen to be the Primary Key.
          Foreign key
          An attribute or set of attributes in one table (the referencing table) that refers to the Primary Key of another table (the referenced table). It is used to establish and enforce a link between the data in two tables.
  76. Which command in mySQL is used to list all (non temporary) tables in a given database.?
    1. VIEW TABLES
    2. SHOW TABLES
    3. DESCRIBE TABLES
    4. DISPLAY TABLES
      • Answer: Option – 2
      • Explanation:
        • In MySQL, the SHOW TABLES command is used to list all non-temporary tables in the currently selected database. It’s a straightforward way to inspect the structure of your database and see what tables are available. The other options listed—VIEW TABLES, DESCRIBE TABLES, and DISPLAY TABLES—are not valid MySQL commands for this purpose.
  77. Which of the following is not true for VARCHAR data type in MySQL ?
    1. Generally faster compared to CHAR data type.
    2. Variable character data type.
    3. A set of character data of Indeterminate length.
    4. Generally memory efficient compared to CHAR data type.
      • Answer: Option – 2
      • Explanation::
        • The main difference in performance is that CHAR is generally faster for storage and retrieval than VARCHAR.
        • CHAR (Fixed-Length): The storage engine knows the exact location of the next column’s data immediately because every value occupies the same amount of space. This makes data access and manipulation slightly faster.
        • VARCHAR (Variable-Length): Since VARCHAR stores a length byte along with the data (to indicate its actual size), the storage engine must read this length byte first to find out where the data ends and the next column begins. This small, extra step adds a negligible overhead, making it generally slower than CHAR, especially in specific scenarios or older MySQL versions.
  78. Identify the output value (ignoring the output header) of the MySQL query.
    SELECT 6 mod 20;
    1. 20
    2. 2
    3. 3
    4. 6
      • Answer: Option – 2
      • Explanation:
        • The output value (ignoring the output header) of the MySQL query SELECT 6 MOD 20; is 6.
          Explanation of the MOD Operator
          The MOD operator in MySQL (which is equivalent to the modulo operator %) calculates the remainder when the first number is divided by the second number.
          The query is:
          $$\text{SELECT } 6 \text{ MOD } 20;$$
          This calculates the remainder of $6 \div 20$.
          $6$ divided by $20$ is $0$ with a remainder of $6$.
          $$6 = (20 \times 0) + 6$$
          Rule: When the dividend (the first number, $6$) is smaller than the divisor (the second number, $20$), the result of the modulo operation is the dividend itself.
  79. Which of the following MySQL query is syntactically correct and most preferred one?
    1. SELECT SECTION, COUNT(*) FROM STUDENT WHERE MARKS < 33 GROUP BY SECTION HAVING COUNT(*) >0 ORDER BY SECTION;
    2. SELECT SECTION, COUNT(*) FROM STUDENT GROUP BY SECTION WHERE MARKS<33 AND COUNT(*)>0 ORDER BY SECTION;
    3. SELECT SECTION, COUNT(*) FROM STUDENT ORDER BY SECTION GROUP BY SECTION WHERE MARKS < 33 AND COUNT(*) > 0;
    4. SELECT SECTION, COUNT(*) FROM STUDENT WHERE MARKS<33 HAVING COUNT(*) > 0 GROUP BY SECTION ORDER BY SECTION;
      • Answer: Option – 1
      • Explanation:
        • SQL Query Execution Order
        • The correctness of a SQL query depends on the mandatory and logical order in which the clauses must appear. The standard order is:
        • SELECT: Specifies the columns/expressions to retrieve.
        • FROM: Specifies the table(s).
        • WHERE: Filters individual rows before grouping.
        • GROUP BY: Groups the rows based on specified column(s).
        • HAVING: Filters groups after grouping (requires an aggregate function like COUNT(*), SUM(), etc.).
        • ORDER BY: Sorts the final result set.
  80. Which of the following MySQL query will display all the name from the table STUDENT, which are having maximum five characters and starting with the alphabet ‘A’?
    1. SELECT NAME FROM STUDENT WHERE NAME = ‘A%%%%’;
    2. SELECT NAME FROM STUDENT WHERE NAME LIKE ‘A%%%%’;
    3. SELECT NAME FROM STUDENT WHERE NAME LIKE ‘A_ _ _ _’;
    4. SELECT NAME FROM STUDENT WHERE NAME =’A_ _ _ _’;
      • Answer: Option – 3
      • Explanation:
        • 'A____' matches any string that:
        • Starts with the letter ‘A’
        • Has exactly five characters (the underscore _ represents a single character, and there are four underscores following ‘A’).

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!
Scroll to Top