O Level Python Paper July 2023
निम्नलिखित भाषा प्रकारों को उनके उदाहरणों से सुमेलित कीजिए।
Match the following language types with their examples.
Language Type Example
1. Interpreted Programming Language a. HTML, SGML, XML
2. Markup Programming Language b. PHP, Apple Script, JavaScript
3. Object-Oriented Programming Language c. Python, BASIC, Lisp
4. Scripting Programming Language d. C++, Ada, Java, Python
Here’s the matching:
-
Interpreted Programming Language: Runs line by line.
Example: Python, BASIC, Lisp (Option c). -
Markup Programming Language: Used to structure data.
Example: HTML, SGML, XML (Option a). -
Object-Oriented Programming Language: Based on objects.
Example: C++, Ada, Java, Python (Option d). -
Scripting Programming Language: Automates tasks.
Example: PHP, Apple Script, JavaScript (Option b).
Answer: (A) 1-c, 2-a, 3-d, 4-b
Correct Answer: A) 1-c, 2-a, 3-d, 4-b
पायथन इंटरप्रेटर को पायथन शेल के रूप में जाना जाता है जो कोड को पढ़ता है और निष्पादित करता है। यह निष्पादन के ______ तरीके प्रदान करता है।
Python Interpreter is known as python shell that reads and executes code. It provides ______ modes of Execution.
Python Interpreter provides two modes of execution:
-
Interactive Mode: Code is executed line by line as it is typed into the Python shell. It is useful for testing small snippets of code.
-
Script Mode: Python code is written in a file (with a
.pyextension) and executed as a complete script. This mode is used for larger programs.
Correct Answer: B) 2
DO…WHILE एग्जिट चेक किया गया लूप है, इसका मतलब है कि लूप को कम से कम _____ निष्पादित किया जाएगा।
DO…WHILE is exit checked loop, it means the loop will be executed at least _____.
DO…WHILE is an exit-checked loop, meaning the loop will be executed at least once, regardless of the condition.
Correct Answer: A) Once
निम्नलिखित में से कौन सी कंप्यूटर की ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग भाषा है?
Which of the following is an Object Oriented Programming Language of Computer?
1. Platform-Independent
- Java code is compiled into bytecode by the Java compiler.
- This bytecode is platform-independent and can run on any device with a Java Virtual Machine (JVM).
2. Object-Oriented Programming (OOP)
- Java is built around the concepts of OOP: Classes, Objects, Inheritance, Polymorphism, Abstraction, and Encapsulation.
3. Simple and Secure
- Java has a clean syntax, eliminating complex features like pointers and manual memory management.
- Security is a key focus, with features like the Java Security Manager and bytecode verification.
4. Robust and Reliable
- Java handles memory management automatically using Garbage Collection.
- It has features like exception handling and type-checking to ensure reliability.
5. Multi-Threading Support
- Java supports multithreaded programming, allowing concurrent execution of two or more threads to maximize CPU utilization.
6. Write Once, Run Anywhere (WORA)
- The same Java program can run on multiple platforms without modification, as long as the JVM is installed.
7. Rich Standard Library
- Java provides an extensive set of pre-built libraries in its Java API for tasks like data structures, networking, database access, GUI development, and more.
8. High Performance with Just-In-Time (JIT) Compiler
- The JIT compiler improves performance by converting bytecode into native machine code at runtime.
9. Syntax Similar to C/C++
- Java adopts a syntax style similar to C/C++, making it easier for developers familiar with these languages to learn Java.
10. Automatic Memory Management
- Java uses an automatic garbage collector to manage memory allocation and deallocation, reducing the risk of memory leaks.
11. Supports Various Frameworks
- Frameworks like Spring, Hibernate, and JavaFX make it easier to build applications ranging from web to desktop and enterprise solutions.
Correct Answer: B) JAVA
यदि a, b, c = 3, 4, 1 है तो Math.sqrt(b)*a-c का मान क्या होगा?
If a, b, c = 3, 4, 1 then what will be the value of math.sqrt(b)*a-c?
Let's break down the expression math.sqrt(b) * a - c step by step, where a = 3, b = 4, and c = 1:
-
math.sqrt(b):
math.sqrt(4)will give the square root of4, which is2.0. -
Multiply by
a:2.0 * 3 = 6.0 -
Subtract
c:6.0 - 1 = 5.0
So, the value of math.sqrt(b) * a - c is 5.0.
Answer: (A) 5.0
Correct Answer: A) 5.0
निम्नलिखित अभिव्यक्ति का आउटपुट क्या होगा
What will be the output of following expression:
print(10/2+3*5)
Let's break down the expression 10/2 + 3*5:
- Division:
10 / 2 = 5.0(division in Python always returns a float). - Multiplication:
3 * 5 = 15. - Addition:
5.0 + 15 = 20.0.
So, the result is 20.0.
Answer: (A) 20.0
Correct Answer: A) 20.0
व्यंजक 5 + 8 * ((3 * 5) - 9)/10 का आउटपुट क्या है?
What is the output of the expression 5 + 8 * ((3 * 5) - 9) / 10?
Let's simplify the expression:
Expression: 5 + 8 * ((3 * 5) - 9) / 10
3 * 5 = 1515 - 9 = 68 * 6 = 4848 / 10 = 4.85 + 4.8 = 9.8
So, the result is 9.8.
Answer: (B) 9.8
Correct Answer: A) 8.8
किस प्रकार का डेटा है:
What type of data is:
arr = [[1,2,3][2,3,4,5]]
The correct code should be:
arr = [[1, 2, 3], [2, 3, 4, 5]]
This creates a list of lists. Each element inside the outer list is another list.
Answer: (C) List of lists
Correct Answer: D) Invalid type
निम्नलिखित कथनों का आउटपुट क्या होगा?
What will be the output of the following statements ?
list1 =[1,2,3,4,5]
print(list1[len(list1)-1])
The list list1 has 5 elements. len(list1) - 1 gives the index of the last element (4), which is 5.
Answer: (A) 5
Correct Answer: A) 5
इसका आउटपुट क्या है:
what is the output of:
import numpy as nd
x= nd.array([2,3,4,10,12,14,18])
print(x[:3])
The slice x[:3] gets the elements from index 0 to 2, which are [2, 3, 4].
Answer: (B) [2 3 4]
Correct Answer: B) [2 3 4]
x का मान क्या है, यदि x = math.factorial(0) ?
What is the value of x, if x = math.factorial(0) ?
The factorial of 0 is defined as 1.
So, if `x = math.factorial(0)`, the value of `x` will be 1
Answer: (A) 1
Correct Answer: A) 1
यदि A = 5, तो A *= 8 के बाद A का मान क्या होगा?
If A = 5, what will be the value of A after A *= 8?
The operation A *= 8 is shorthand for A = A * 8.
- Initially,
A = 5. - After
A *= 8, it becomesA = 5 * 8 = 40.
So, the value of A after A *= 8 will be 40.
Answer: (A) 40
Correct Answer: A) 40
x का मान क्या है, यदि x = math.sqrt(25.0)?
What is the value of x, if x = math.sqrt(25.0) ?
The math.sqrt() function in Python returns the square root of a number, which is always non-negative.
For x = math.sqrt(25.0):
- The square root of
25.0is5.0.
So, the value of x will be 5.0.
Answer: (C) 5.0
Correct Answer: C) 5.0
निम्नलिखित for लूप कितनी बार निष्पादित होगा? exp: "56247839"
How many times will the following for loop execute? exp: “56247839”
To determine how many times the for loop will execute, let's analyze the string "56247839".
If the loop is iterating over each character in the string, it will run once for each character.
The string "56247839" has 8 characters.
So, the for loop will execute 8 times.
Answer: (B) 8
Correct Answer: B) 8
निम्नलिखित अंकगणितीय अभिव्यक्ति को क्रियान्वित करने पर क्या मान प्रदर्शित होगा?
What value will be displayed on executing the following arithmetic expression?
x = math.pow (0,-4)
Raising 0 to a negative exponent is mathematically undefined because it would involve dividing by zero.
In Python, this results in an error.
Answer: (C) DomainError
Correct Answer: C) DomainError
पहचान कीजिए कि दिए गए कथन सत्य हैं या असत्य।
Identify whether the given statements are true or false.
In Python programming, tuple items are ordered.
iIn Python programming, we cannot change, add or delete items once a tuple is created.
In Python programming, tuple does not give duplicate values.
- Tuples are ordered: True (Order is maintained in a tuple).
- Tuples are immutable: True (You can't change, add, or remove items in a tuple).
- Tuples don't allow duplicates: False (Tuples can have duplicate values).
Answer: (B) i- True, ii- True, iii- False
Correct Answer: B) i- True, ii- True, iii- False
व्यंजक 34 // 5 + 34 % 5 का परिणाम क्या है?
What is the result of the expression 34 // 5 + 34 % 5?
Let's break down the expression step by step:
Expression: 34 // 5 + 34 % 5
-
Floor Division (
//):34 // 5is the quotient of 34 divided by 5, ignoring the remainder.34 // 5 = 6
-
Modulo (
%):34 % 5gives the remainder when 34 is divided by 5.34 % 5 = 4
-
Addition:
6 + 4 = 10
So, the result is 10.
Answer: (C) 10
Correct Answer: C) 10
निम्नलिखित बिट कोड का उत्पादन क्या होगा?
What would the following bit of code produce?
List = [“yellow” , “red” , “green” ,“pink”]
del list[2]
print(list)
The del list[2] removes the item at index 2, which is "green". The resulting list will be ["yellow", "red", "pink"].
Answer: (D) ["yellow", "red", "pink"]
Correct Answer: D) [“yellow” , “red” ,“pink”]
निम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?
What will be the output of the following Python function?
len(["hello", 2, 4, 6])
The function len() returns the number of items in a list.
Here, the list is ["hello", 2, 4, 6], which contains 4 elements: "hello", 2, 4, and 6.
So, the output will be 4.
Answer: (B) 4
Correct Answer: B) 4
निम्नलिखित में से कौन-सा विकल्प पायथन प्रोग्रामिंग भाषा (Python programming language) के लिए मान्य है?
Which of the following options is valid for Python programming language?
I. An interpretation-based language
II. An object-oriented language
III. A high-level programming language
IV. A machine-dependent language