1.
The basic operations performed by a computer are?
Correct Answer
D. All the above
Explanation
The basic operations performed by a computer include arithmetic operations, logical operations, and storage and retrieval. Arithmetic operations involve mathematical calculations such as addition, subtraction, multiplication, and division. Logical operations involve comparisons and decision-making using logical operators like AND, OR, and NOT. Storage and retrieval refer to the ability of a computer to store and access data from memory or storage devices. Therefore, the correct answer is "All the above" as all of these operations are fundamental to computer functioning.
2.
Microprocessors as switching devices are for which generation computers?
Correct Answer
D. Fourth Generation
Explanation
Microprocessors as switching devices are primarily associated with the Fourth Generation of computers. This generation, which emerged in the late 1970s and lasted until the mid-1980s, was characterized by the use of microprocessors as the central processing unit (CPU) in computers. Microprocessors enabled computers to become smaller, more powerful, and more affordable. They revolutionized the field of computing by integrating multiple components onto a single chip, making computers more efficient and accessible. Therefore, the use of microprocessors as switching devices aligns with the advancements of the Fourth Generation of computers.
3.
The brain of any computer system is:
Correct Answer
CPU
Explanation
The brain of a computer system is the CPU, or Central Processing Unit. The CPU is responsible for executing instructions and performing calculations, making it the most important component of a computer. It processes data and controls the other hardware components, allowing the computer to perform tasks and run programs. Without the CPU, a computer would not be able to function or carry out any operations. Therefore, the CPU is often referred to as the brain of the computer system.
4.
Which of the following is not a keyword?
Correct Answer
A. Eval
Explanation
The keyword "eval" is used in Python to evaluate a string as a Python expression. It is not a function or a variable, but a keyword that performs a specific action. Therefore, "eval" is a keyword in Python, making it the incorrect answer to the question.
5.
Which one of these is floor division?
Correct Answer
B. //
Explanation
The double slash "//" is the floor division operator in Python. Floor division returns the largest integer that is less than or equal to the division of the two operands. It essentially rounds down the result to the nearest whole number. This is different from the regular division operator "/" which returns the exact quotient as a float. The percentage symbol "%" is the modulus operator, used to find the remainder of the division. Therefore, the correct answer is "//".
6.
Mathematical operations can be performed on a string.
Correct Answer
B. False
Explanation
Mathematical operations cannot be performed on a string. Strings are sequences of characters and do not have numerical values that can be manipulated using mathematical operations like addition, subtraction, multiplication, or division. Mathematical operations are only applicable to numerical data types like integers or floating-point numbers.
7.
For tuples and list which is correct?
Correct Answer
B. List is mutable whereas tuples are immutable.
Explanation
The correct answer is "List is mutable whereas tuples are immutable." This means that lists can be changed or modified after they are created, while tuples cannot be changed once they are created.
8.
What is the output of the following?
for i in [1, 2, 3, 4][::-1]:
print (i)
Correct Answer
B. 4 3 2 1
Explanation
The given code snippet uses a for loop to iterate over the list [1, 2, 3, 4] in reverse order (using the slicing syntax [::-1]). The loop prints each element of the list on a new line. Therefore, the output of the code will be "4 3 2 1", with each number printed on a separate line.
9.
Which of the following functions is a built-in function in python?
Correct Answer
D. Print()
Explanation
The function "print()" is a built-in function in Python. It is used to display output on the console. It takes one or more arguments and prints them as a single string or multiple values. This function is commonly used for debugging purposes and to display information to the user.
10.
What is the output of the expression:
round(4.576)
Correct Answer
B. 5
Explanation
The round() function is used to round a number to the nearest whole number. In this case, the number 4.576 is rounded to the nearest whole number, which is 5.
11.
What data type is the object below?
L = [1, 23, ‘hello’, 1].
Correct Answer
A. List
Explanation
The object L is a list because it is enclosed in square brackets and contains a sequence of elements separated by commas. Lists are a type of data structure in Python that can hold different types of data, including numbers, strings, and other objects. In this case, the list contains the elements 1, 23, 'hello', and 1.
12.
A device used for video games, flight simulators, training simulators, and for controlling industrial robots.
Correct Answer
C. Joystick
Explanation
A joystick is a device commonly used for video games, flight simulators, training simulators, and controlling industrial robots. It allows users to have precise control over movements in a virtual environment or real-world applications. Unlike a mouse or keyboard, a joystick provides a more intuitive and immersive experience, especially in situations that require precise and continuous input. It typically consists of a lever that can be moved in various directions to control the movement of an object or character on the screen. Therefore, the joystick is the most suitable option for the given description.
13.
The following box denotes?
Correct Answer
A. Decision
Explanation
The correct answer is "Decision" because a decision is a choice made between different alternatives based on certain criteria or conditions. In this context, the box represents a decision point where a choice needs to be made. It is different from initiation, initialization, and I/O, which refer to other processes or actions.
14.
Which of the following represents the bitwise XOR operator?
Correct Answer
B. ^
Explanation
The bitwise XOR operator is represented by the symbol "^". It is used to perform an exclusive OR operation on two binary numbers. This operation returns a 1 if the corresponding bits in the two numbers are different, and 0 if they are the same.
15.
What arithmetic operators cannot be used with strings?
Correct Answer
C. –
Explanation
The subtraction operator (–) cannot be used with strings. This is because subtraction is not a valid operation for strings in arithmetic. Strings are a sequence of characters and do not have a numerical value that can be subtracted. The plus operator (+) and the multiplication operator (*) can be used with strings for concatenation and repetition respectively. Therefore, the correct answer is –.