0% found this document useful (0 votes)
181 views

11th Ch-2 Basic Concepts of Python Programming 2025-26

The document covers basic concepts of Python programming, including multiple choice questions, short answer questions, and long answer questions. It discusses topics such as the default editor (IDLE), the Integrated Development Environment (IDE), variables, tokens, identifiers, literals, and comments. The document is prepared by Vikas Kansal from S.U.S. Govt. S. S. School.

Uploaded by

gejyt81
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
181 views

11th Ch-2 Basic Concepts of Python Programming 2025-26

The document covers basic concepts of Python programming, including multiple choice questions, short answer questions, and long answer questions. It discusses topics such as the default editor (IDLE), the Integrated Development Environment (IDE), variables, tokens, identifiers, literals, and comments. The document is prepared by Vikas Kansal from S.U.S. Govt. S. S. School.

Uploaded by

gejyt81
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Computer Science Punjab (http://cspunjab.nirmancampus.co.

in/) Page: 3
Chapter-2nd
Basic Concepts of Python Programming

A. Multiple Choice Questions:


1. The ______________ is a default editor that accompanies Python.
a. IDLE b. IPLE c. Text Editor d. Notepad
2. The ______________ is the shell prompt where we type in our commands.
a. << b. >> c. >>> d. <<<
3. IDE stands for _____________________________
a. Integrated Direct Environment b. Integrated Development Environment
c. Information Development Environment d. None of these
4. To run a script file code in Python, we can use ___________ shortcut key.
a. F1 b. F2 c. F5 d. F7
5. ___________ are like words and punctuation marks in English language.
a. Literals b. Identifiers c. Variables d. Tokens
6. ____________ are the names given to program elements, such as variable, function, list, tuples, etc. for their
identification.
a. Literals b. Identifiers c. Variables d. Tokens
7. Literals are the______________ values used in a source code.
a. Fixed b. Boolean c. String d. Float
8. ___________ are those identifiers which are used to store values and they allow us to change their value during
runtime
a. Constant b. Variable c. List d. Tokens
9. A comment is basically a text that gives an ______________ about the program code.
a. Execution b. Compilation c. Explanation d. All of these
10. We can display program data to the console in Python with ________ function.
a. input() b. print() c. output() d. show()

Ans: 1) a. IDLE 2) c. >>> 3) b. Integrated Development Environment


4) c. F5 5) d. Tokens 6) b. Identifiers
7) a. Fixed 8) b. Variable 9) c. Explanation 10) b. print()

B. Short Answer Type Questions:


Que 1: What do you know about Python?
Ans: 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).
Que 2: What is IDE?
Ans: IDE stands for Integrated Development Environment. It is a software that is dedicated to software
development. IDEs integrate several tools for software development. These usually include the following tools:
 A Text Editor to handle Source Code
 Build, Execution, and Debugging Tools
Que 3: How can you view the list of Keywords using Python Shell? Write some examples of Keywords.
Ans: Keywords are also known as Reserve Words. To view the list of keywords using the Python shell, we can use
the following Python statements:
>>> import keyword
>>> print(keyword.kwlist)
Some of examples of keywords are: True, False, if, elif, else, while, for etc.
Que 4: How will you declare variables in Python? Given Examples.
Ans: 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:
x = 12
In this example, the variable 'x' is declared as an integer variable.

Prepared By: Vikas Kansal (Computer Faculty) S.U.S. Govt. S. S. School (G), Sunam Udham Singh Wala
Computer Science Punjab (http://cspunjab.nirmancampus.co.in/) Page: 4
Que 5: Why print() function is used in Python programs?
Ans: 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:
print(“Hello”, "Students") Hello Students
print(“How are you?”) How are you?

C. Long Answer Type Questions:


Que 1: Define Tokens? Explain various types of tokens used in Python.
Ans: 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:
 Keywords: These are the Reserve Words.
 Identifiers: These are the names given to program elements, such as variables, functions etc.
 Literals: These are the fixed values used in the Source Code.
 Operators: These tokens are used to perform operations in the expressions.
 Delimiters: These are special characters that play specific roles (grouping, punctuation, etc.) in Python.
Que 2: What are Identifiers? Write their naming rules.
Ans: 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:
 Identifiers must be made up of a combination of lowercase (a-z) or uppercase (A-Z) alphabets, digits (0-9)
or underscore (_).
 Identifiers cannot start with a digit.
 No keyword can be used as an identifier.
 No symbol or special character other than underscore (_) can be used in identifiers.
 Identifiers can be of any length; there is no restriction on the length of identifiers.
 Python is a case sensitive language. Therefore, the case of the alphabet is important in naming identifiers.
For example: roll and ROLL are two different identifiers.
 Whitespaces cannot be used in an identifier.
Que 3: What are Literals? Draw a chart to represents the different types of literals used in Python.
Ans: 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:

Que 4: What are Comments? Write the different ways of writing comments in Python.
Ans: 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:
 Single Line Comments: These comments are written in a single line. For Example:
# This is an example of a single comment
 Multiline or Block Comments: These comments are written in more than one line. For Example:
“““This is a multiline
comment.”””

Prepared By: Vikas Kansal (Computer Faculty) S.U.S. Govt. S. S. School (G), Sunam Udham Singh Wala

You might also like