|
11th (ਕੰਪਿਊਟਰ ਸਾਇੰਸ/Computer Science) - 2026-27
ਪਾਠ-2/Chapter-2 |
| Q-1. |
|
|
|---|---|---|
| Q-1. Objective |
1) IDLE/IDLE Ans.) IDLE/IDLE |
| Q-2. |
|
|
|---|---|---|
| Q-2. Objective |
1) <</<< Ans.) >>>/>>> |
| Q-3. |
|
|
|---|---|---|
| Q-3. Objective |
1) Integrated Direct Environment/Integrated Direct Environment Ans.) Integrated Development Environment/Integrated Development Environment |
| Q-4. |
|
|
|---|---|---|
| Q-4. Objective |
1) F1/F1 Ans.) F5/F5 |
| Q-5. |
|
|
|---|---|---|
| Q-5. Objective |
1) Literals/Literals Ans.) Tokens/Tokens |
| Q-6. |
|
|
|---|---|---|
| Q-7. Objective |
1) Fixed/Fixed Ans.) Fixed/Fixed |
| Q-7. | |
| Q-8. Objective |
1) Constant/Constant Ans.) Variable/Variable |
| Q-8. |
|
|
|---|---|---|
| Q-9. Objective |
1) Execution/Execution Ans.) Explanation/Explanation |
| Q-9. |
|
|
|---|---|---|
| Q-10. Objective |
1) input()/input() Ans.) print()/print() |
| Q-10. |
|
|
|---|---|---|
| Q-1. Short Answer Type Questions |
Python is a popular programming language. It was developed by Guido Van Rossum. It was introduced in 1991. After that, it was developed by the Python Software Foundation. It is a general-purpose High-Level Programming language. The code produced in this language is small and flexible. Python is often used in the fields of Data Science, AI (Artificial Intelligence), and ML (Machine Learning). Python is a popular programming language. It was developed by Guido Van Rossum. It was introduced in 1991. After that, it was developed by the Python Software Foundation. It is a general-purpose High-Level Programming language. The code produced in this language is small and flexible. Python is often used in the fields of Data Science, AI (Artificial Intelligence), and ML (Machine Learning). |
| Q-11. |
|
|
|---|---|---|
| Q-2. Short Answer Type Questions |
IDE stands for Integrated Development Environment. It is a software that is dedicated to software IDE stands for Integrated Development Environment. It is a software that is dedicated to software |
| Q-12. |
|
|
|---|---|---|
| Q-3. Short Answer Type Questions |
Keywords are also known as Reserve Words. To view the list of keywords using the Python shell, we can use the following Python statements: Keywords are also known as Reserve Words. To view the list of keywords using the Python shell, we can use the following Python statements: |
| Q-13. |
|
|
|---|---|---|
| Q-4. Short Answer Type Questions |
Variable are used to hold values in memory. There is no special command in Python to declare a variable. A variable comes into existence in memory automatically when we assign a value to it. The interpreter allocates memory to the variable according to the data type of the value assigned to it. For example: Variable are used to hold values in memory. There is no special command in Python to declare a variable. A variable comes into existence in memory automatically when we assign a value to it. The interpreter allocates memory to the variable according to the data type of the value assigned to it. For example: |
| Q-14. |
|
|
|---|---|---|
| Q-5. Short Answer Type Questions |
The print() function is used to display output in Python programs. This function can be used to display program data on the console screen. By default, the print() function displays values separated by a single space. This function inserts a newline at the end after displaying its output. Example: Output: The print() function is used to display output in Python programs. This function can be used to display program data on the console screen. By default, the print() function displays values separated by a single space. This function inserts a newline at the end after displaying its output. Example: Output: |
| Q-15. |
|
|
|---|---|---|
| Q-1. Long Answer Type Questions |
Every program is made up of different types of tokens. These tokens are like words and punctuation marks in the English language. They are the smallest individual elements in a program. The tokens used in Python programs are described below: Every program is made up of different types of tokens. These tokens are like words and punctuation marks in the English language. They are the smallest individual elements in a program. The tokens used in Python programs are described below: |
| Q-16. |
|
|
|---|---|---|
| Q-2. Long Answer Type Questions |
The names given to program elements such as variables, functions, etc. are called identifiers. To define the names of elements in a program, we have to use the following naming rules:
For example: roll and ROLL are two different identifiers.
The names given to program elements such as variables, functions, etc. are called identifiers. To define the names of elements in a program, we have to use the following naming rules:
For example: roll and ROLL are two different identifiers.
|
| Q-17. |
|
||
|---|---|---|---|
| Q-3. Long Answer Type Questions |
Literals are fixed values that are used in the source code of a program. These values are usually assigned to program elements, such as variables, etc. The different types of literals used in Python are shown in the chart shown below:
Literals are fixed values that are used in the source code of a program. These values are usually assigned to program elements, such as variables, etc. The different types of literals used in Python are shown in the chart shown below:
|
| Q-18. |
|
|
|---|---|---|
| Q-4. Long Answer Type Questions |
Comments are the integral part of a program. A comment in the program is a text that explains the code written in the program. The compiler and interpreter ignore these comments and do not execute them. They make the code easier to understand. There are mainly two ways to write comments in Python programs: 2) Multiline or Block Comments: These comments are written in more than one line. For Example: Comments are the integral part of a program. A comment in the program is a text that explains the code written in the program. The compiler and interpreter ignore these comments and do not execute them. They make the code easier to understand. There are mainly two ways to write comments in Python programs: 2) Multiline or Block Comments: These comments are written in more than one line. For Example: |