0% found this document useful (0 votes)
1K views

Class 9 Python Question Answers For Theory Exam

The document discusses Python questions and answers related to key features, modes of coding, comments, variables, input/output, and type conversion. It provides details on Python's applications, interactive and script modes, single-line and multi-line comments, rules for naming variables and constants, using print() and input() functions, and type conversion examples.

Uploaded by

Bhavya Angurana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Class 9 Python Question Answers For Theory Exam

The document discusses Python questions and answers related to key features, modes of coding, comments, variables, input/output, and type conversion. It provides details on Python's applications, interactive and script modes, single-line and multi-line comments, rules for naming variables and constants, using print() and input() functions, and type conversion examples.

Uploaded by

Bhavya Angurana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Ch Python

Question Answers (For theory Paper)

Q1) What are the key features of python ? Mention various applications along with it

Features of Python

Applications of Python

1. We can use Python to develop web applications.


2. Python is useful for the software development process. It works as a support language
and can be used to build control and management, testing, etc.
3. Python language is the most suitable language for Artificial intelligence or machine
learning. It consists of many scientific and mathematical libraries, which makes easy to
solve complex calculations.
4. Python is flexible to perform multiple tasks and can be used to create multimedia
applications.
5. Python contains many libraries that are used to work with the image.

Q2) What are the different modes for coding in python?

Ans. The different modes in Python are:

1. Script mode is where you write your code in a .py file and then run it with the python
command. This is the most common way that people use Python because it lets you write
and save your code so that you can use it again later. Script mode produces output that can
be saved and reused.
2. Interactive mode is where you type your code into the Python interpreter directly. This is
useful for trying out small snippets of code, or for testing things out as you’re writing them.
Interactive mode produces output that is displayed on the screen and then disappears.
Q3) What are comments in python ? List down the various types of comments.

A comment is text that doesn't affect the outcome of a code, it is just a piece of text to let someone
know what you have done in a program or what is being done in a block of code. In Python, we use the
hash (#) symbol to start writing a comment.

Single-Line Comments in Python


Python single-line comment starts with the hash symbol (#) with no white
spaces and lasts till the end of the line. I
Multi-Line Comments in Python
Python multi-line comment starts with the triple quotes (‘’’) and ends with triple
quotes(‘’’)

Q4) What are the different properties of an identifier ?

Q5) What are the rules for naming of variables and constants
Q6) Explain python input and output with the help of an example.

Python Output Using print() function

We use the print() function to output data to the standard output device (screen). We can also
output data to a file. An example is given below.

a = "Hello World!"

print(a)

User input

In python, input() function is used for taking input from user at the time of execution. Input can
be any value, like integer, string, floating number,etc.

Q7) What is type conversion ? Explain the types of type conversion with the help of an

example.

Example:

A=10
B= 20.5
S=A+B
print(S)

In above code, interpreter automatically convert integer value of variable A to float value at the
time of addition with floating number.
Example:

A=10
B= 20.5
Sum =A+int(B)
print(sum)

In the above code, data type of variable B is converted to integer by the user.

Q8) What is a variable? Give example.

You might also like