All mock tests are FREE till 31 December — register to save your progress
HTET PGT CS · UNIT 03

Programming Concepts & Python – Previous Year Questions

38 questions from past HTET PGT Computer Science papers, each with the correct answer. Open any question for its explanation.

  1. In Python .......... function returns the number of characters in string argument.
    Answer: B. Len HTET 2024 PGT Computer Science · 30 July 2025
  2. Which programming pays more attention on data rather than functions?
    Answer: C. Object Oriented Programming HTET 2024 PGT Computer Science · 30 July 2025
  3. .......... refers to the procedure of representing essential features without including the background details.
    Answer: A. Abstraction HTET 2024 PGT Computer Science · 30 July 2025
  4. In Python Dictionaries organize the information by ........, not position.
    Answer: D. Association HTET 2024 PGT Computer Science · 30 July 2025
  5. In Python "==" operator returns true if :
    Answer: B. Content of two different objects are same HTET 2024 PGT Computer Science · 30 July 2025
  6. A .......... is the specification of legal values for variable of the type.
    Answer: A. Data Types HTET 2024 PGT Computer Science · 30 July 2025
  7. In Python .......... operator is used to determine the element's presence or absence in list.
    Answer: B. in HTET 2024 PGT Computer Science · 30 July 2025
  8. In Python, .......... is the type of sequence that resembles a list, except that, unlike a list, it is immutable.
    Answer: D. Tuple HTET 2024 PGT Computer Science · 30 July 2025
  9. .......... is a set of rules for carrying out some calculation either by hand or by machine.
    Answer: C. Algorithm HTET 2024 PGT Computer Science · 30 July 2025
  10. Which procedure is characterized by the fact that the procedure calls itself again and again till the base condition is met?
    Answer: C. Recursive HTET 2024 PGT Computer Science · 30 July 2025
  11. If a class contains at least one pure virtual function, it is called as ............. class.
    Answer: B. Abstract HTET 2023 PGT Computer Science
  12. Tuples in Python are :
    Answer: B. immutable HTET 2023 PGT Computer Science
  13. In python elements of the list are written inside :
    Answer: A. [ ] HTET 2023 PGT Computer Science
  14. Pictorial representation of an algorithm is called as :
    Answer: C. Flowchart HTET 2023 PGT Computer Science
  15. In Python dictionary key value pairs are separated by :
    Answer: A. : HTET 2023 PGT Computer Science
  16. In Python instance methods use ........... as first default parameter.
    Answer: C. self HTET 2023 PGT Computer Science
  17. Step by step description of how to arrive at a solution to a given problem is known as :
    Answer: A. Algorithm HTET 2023 PGT Computer Science
  18. This module converts the python source file into .pyc file :
    Answer: D. py_compile HTET 2023 PGT Computer Science
  19. The software containing an interpreter that converts the byte code into machine code where the python program runs is called as :
    Answer: B. Python Virtual Machine HTET 2023 PGT Computer Science
  20. Which of the following constructor related concept is non-relevant in C++ ?
    Answer: D. virtual constructor HTET 2022 PGT Computer Science
  21. In C++, which of the following is not a derived container under STL ?
    Answer: B. deque HTET 2022 PGT Computer Science
  22. In C++, an overloaded unary operator defined as a member function requires how many variables to be passed as function argument ?
    Answer: A. Zero HTET 2022 PGT Computer Science
  23. How many times 'save trees' will be displayed by C++ loop ? do { cout << "save trees"; } while(0);
    Answer: A. One HTET 2022 PGT Computer Science
  24. Consider Column-I and Column-II in context of C++ : Column-I Column-II i. Private a. Data type modifier ii. Sizeof b. Visibility specifier iii. Static c. Operator iv. Long d. Storage class Match of Column-I and Column-I…
    Answer: D. i-b, ii-c, iii-d, iv-a HTET 2022 PGT Computer Science
  25. Choose true statements about virtual functions in C++ : I : The virtual functions must be member of some class. II : They cannot be static members. III: A virtual function can be a friend of another class.
    Answer: D. I, II and III HTET 2022 PGT Computer Science
  26. In context of C++, which of the following is a valid statement ?
    Answer: C. Keywords private, protected and public may appear in any order and any number o… HTET 2022 PGT Computer Science
  27. In C file handling equivalent to scanf("%d",&val); is :
    Answer: A. fscanf(stdin, "%d",&val); HTET 2021 PGT Computer Science
  28. A variable declared within the block {} has the following scope :
    Answer: B. Local Scope HTET 2021 PGT Computer Science
  29. What is a copy constructor ?
    Answer: B. A constructor to initialize an object with the values of another object. HTET 2021 PGT Computer Science
  30. In the given declaration of an array : float height[50];
    Answer: A. height[0] refers to first element of array. HTET 2021 PGT Computer Science