11th Ch-2 Basic Concepts of Python Programming 2025-26
11th Ch-2 Basic Concepts of Python Programming 2025-26
in/) Page: 3
Chapter-2nd
Basic Concepts of Python Programming
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?
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