These Class 10 AI Important Questions Chapter 7 Introduction to Python Class 9 AI Important Questions and Answers NCERT Solutions Pdf help in building a strong foundation in artificial intelligence.
Introduction to Python Class 9 Important Questions
Class 9 AI Introduction to Python Questions
Important Questions of Introduction to Python Class 9 – Class 9 Introduction to Python Important Questions
Introduction to Python Class 9 AI Very Short Answer Type Questions
Question 1.
Who developed the Python?
Answer:
Python was initially designed by Guido Van Rossum in 1991 and developed by Python Software Foundation.
Question 2.
Python is which type of programming language?
Answer:
Python is an Object Oriented Programming language.
Question 3.
What is the extension of Python files?
Answer:
Python files have extension .py.
Question 4.
Python is based on which type of programming language?
Answer:
Python is based on two types of programming languages as
(i) ABC language
(ii) Modula-3
![]()
Question 5.
Python is portable language. Give reason.
Answer:
Python is portable language because it can run on any machine or platform without any changes.
Question 6.
Give an advantage of Python language.
Answer:
Python is an easy to use and easy readability language.
Question 7.
How can you start Python with command line?
Answer:
Start → All Programs → Python version → Python (32-bit).
Question 8.
What will be the output of following code at command line?
![]()
Answer:
Sum of 10 and 20 is 30.
Question 9.
What is the full form of IDLE?
Answer:
Integrated Development Environment.
Question 10.
Abhay is working on IDLE (Python GUI). He has finished his coding and now wants to exit from IDLE. How can he exit from IDLE?
Answer:
Press Ctrl+D or File → Exit or Click on cross ☒ title bar.
Question 11.
Define the term operator.
Answer:
Operators are symbols which take one or more operands to perform arithmetic or logical computations.
![]()
Question 12.
What is data type?
Answer:
Data type is a term that is used to show the kind of data values or the type of data that is expected to be handled.
Question 13.
Explain unary operator.
Answer:
A unary operator is an operator that performs its operation on only one operand.
Question 14.
What is an expression?
Answer:
Combination of operands and operators form an expression.
Question 15.
Differentiate between / and % operators.
Answer:
operator is used to find the quotient while % operator is used to find the remainder.
![]()
Question 16.
Write the proper Python syntax for testing that value of A is between 2 and 9 inclusively.
Answer:
A > = 2 and A < = 9
Question 17.
What is the use of relational operator?
Answer:
The relational operators are used for comparison between two or more operands.
Question 18.
Differentiate between = and = = operators.
Answer:
= is an assignment operator whereas = \pm is a relational operator.
Question 19.
Write the augmented assignment operators used in Python.
Answer:
+ = ? = , * = , / = , % = , / / = , =
Question 20.
What will be the output of following code?
a = 7
b = – 7
print (“a=”,+a)
print (“b=”,+b)
Answer:
Output
a = 7
b = -7
Question 21.
Name three logical operators.
Answer:
(i) AND operator (and)
(ii) OR operator (or)
(iii) NOT operator (not)
![]()
Question 22.
What will be the result of following expression?
-a< = 5
(i) if a = 5
(ii) if a = -5
Answer:
(i) True
(ii) True
Question 23.
Write the value stored in the variable Num by each of the following statements.
(i) Num = 2 * 3-4
(ii) Num = 2+3-1 * 3
(iii) Num = (2+3) * 2
Answer:
(i) Num = 2
(ii) Num = 2
(iii) Num = 10
Introduction to Python Class 9 AI Short Answer Type Questions
Question 1.
What is Python? Explain.
Answer:
Python is a general purpose interpreted, interactive, object oriented and high level programming language. It was initially designed by Guido Van Rossum in 1991 and developed by Python Software Foundation.
Question 2.
Python is free and open source, what is it mean?
Answer:
Python language is developed under an OSI-approved open source license, which makes it free to use and distribute, including for commercial purposes.
![]()
Question 3.
What is the difference between interactive mode and script mode in Python?
Answer:
Interactive mode is used when an user wants to run one single line or one block of code. While script mode is used when the user is working with more than one single code or a block of code.
Question 4.
What is the output of the following code?

Answer:
Welcome to Python.
Practice makes a man perfect.
Difference between 10 and 5 is 5
Question 5.
What do you mean by IDLE in Python?
Answer:
IDLE is Integrated Development Environment for editing and running Python 2.X or Python 3 programs. The IDLE GUI (Graphical User Interface) is automatically installed with the Python interpretër. IDLE was designed specifically for using with Python.
IDLE has a number of features to help you develop your Python programs including powerful syntax highlighting.
Question 6.
Determine the output.
(i) x = -4
y = -x
print (” value of x = “, x )
print (” value of y = “, y )
Answer:
value of x = -4
value of y = 4
(ii) x = 2
y = 3
z = x * * y + 3
x = y + 5
print(“value of z = “, z)
print(” value of x = “, x)
Answer:
value of z = 11
value of x = 8
![]()
Question 7.
Predict the output of the following code fragment.
b = 20
a = 90 / b
print (“value of a is : “, a)
Answer:
value of a is : 4.5
Question 8.
Using the given values of x, y and z, evaluate the following:
![]()
(i) x = 5, y = 6, z = 20
(ii) x = 10, y = 4, z = 11
Answer:
(i) False
(ii) True
Question 9.
Predict the output of the following program.
a = 5
~b = a = 15
c = (a<15)
print (“a = “, a)
print (“b = “,’b)
print (“c = ‘, c)
Answer:
a = 15
b = 15
c = False
Question 10.
What will be the value of following if a = 2 ?
(i) (12 /+a) % 3
(ii) (21 *+a) % 9
(iii) (21 //+a) % 3
Answer:
(i) 0.0
(ii) 6
(iii) 1
Introduction to Python Class 9 AI Long Answer Type Questions
Question 1.
Write the applications of Python?
Answer:
Python is a versatile programming language with a wide range of applications, including:
Web Development Python is popular for building web applications due to its simplicity and frameworks like Django and Flask that make development faster. These frameworks handle many of the complexities of web development, so you can focus on the core functionality of your application.
Data Sciençe and Machine Learning Python is a leader in data science and machine learning because of its extensive libraries like Pandas, NumPy, and Scikit-learn.
These libraries provide tools for data manipulation, analysis, and creation of machine learning models.
Scientific Computing Python is a great choice for scientific computing because of its ease of use and powerful libraries like SciPy and Matplotlib. These libraries allow for numerical computations, data analysis, and visualization.
Automation Python can be used to automate tasks on your computer, such as file manipulation, data processing, and web scraping. Libraries like Selenium and Beautiful Soup can automate interactions with web pages.
Game Development Python can be used to create games, both simple and complex. Libraries like Pygame provide a foundation for building games.
Desktop Applications Python can be used to create desktop applications with graphical user interfaces (GUIs) using libraries like Tkinter or PyQt.
Other Applications Python is also used in many other domains, including image processing, audio processing, network programming, and system administration.
![]()
Question 2.
Write down the steps for downloading and installing Python.
Answer:
To download a Python setup, follow the steps given below
(i) Enter Python.org in URL. A window will be appear. Select Downloads tab, after this a pop-up will appear.
(ii) Click on Python 3.7 .3 button to download. The file named 3.7.3.exe should start downloading into your standard download folder.
(iii) Move this file to more permanent location, so that you can install Python.
To install Python, follow the steps given below
(i) Open Downloads folder where Python setup was saved. Double click on the file python-3.7.3.exe.
(ii) An Open File-Security Warning dialog box will appear as shown below.
(iii) Click on Run button.
A Python 3.7 .3 (32-bit) Setup pop-up window will appear.
(iv) Highlight the install now (or upgrade now) message and then click it. A user account control pop-up window will appear, that asked the question. Do you want to allow the following program to make changes to this computer?
(v) Click on Yes button.
A new Python 3.7 .3 (32-bit) Setup pop-up window will appear, with a Setup Progress message and a progress bar.
During installation, it will show the various components that are installing and move the progress bar towards completion. Soon, a new Python 3.7.3 ( 32 bit) Setup pop-up window will appear, with a “Setup was successful” message.
![]()
(vi) Click the Close button.
Question 3.
What are the different ways to run programs in Python?
Answer:
Refer to text on page no. 217 and 218 (Working in Python).
Question 4.
Describe identifiers and keywords.
Answer:
Refer from text on page no. 224 and 225 (Identifiers and keywords).
Question 5.
Explain various operators in Python.
Answer:
Refer from text on page no. 225 (Operators).
Question 6.
Write a Python program which input the time in seconds and convert it into days. Also, display its output.
Answer:

Question 7.
Write a program which input three sides of triangle and calculate its perimeter, semi perimeter and area.
Answer:

Output
Enter the First side of a Triangle: 13
Enter the Second side of a Triangle: 12
Enter the Third side of a Triangle: 5
The Perimeter of the Triangle = 30.00
The Semi Perimeter of the Triangle = 15.00
The Area of the Triangle = 30.00
![]()
Question 8.
The distance between two cities (in km) is input through the keyboard, write a Python program to convert this distance in meters.
Answer:

Output
Enter the distance in km: 2.5
Distance in km : 2.5
Distance in meters : 2500.0
Question 9.
Write a Python program to find the perimeter of a rectangle.
Answer:

Output
Enter the length : 6
Enter the breath : 4
Length : 6
Breath : 4
Perimeter of the rectangle : 20
![]()
Question 10.
Write a program to calculate the volume of sphere and hemisphere with using math modules. Also, display the appropriate output.
Volume of sphere = 4 / 3 π r3
Volume of hemisphere = 2 / 3 π r3
Answer:

Output
Calculate the Volume of Sphere
Enter the radius of a sphere : 5
Radius of Sphere : 5
Volume of Sphere : 523.3333333333334
Calculate the Volume of Hemisphere
Enter the radius of a hemisphere : 4
Radius of Hemisphere : 4
Volume of Hemisphere : 133.97333333333333
Question 11.
Predict the output:
(i) a = 3
b = a*2
print(a*3+6+b)
Answer:
21
(ii) a, b = 12,10
c = a // b+4 * 2
d = c-10
print(d)
Answer:
-1
(iii) a = 5
b = 6
((a and b)
or ( a>b ) )
Answer:
6
![]()
(iv) a = 4
b = 6
c = 10
( a> = b )
or ( (c = = b)
and (not(c<a) ))
Answer:
False
(v) a = 4
b = 6
c = 10
(a< = b) and
((c = m = a) and
(not(c<b) ))
Answer:
False
(vi) a = 60
b = 10
c = 85 / b+a
print(c)
Answer:
68.5
(vii) a = 3
b = 4
c = a * * b + 5
print(c)
Answer:
86
![]()
(viii) b = 89
a = 78
c = (a < = b)
print(c)
Answer:
True
Introduction to Python Class 9 AI Activities
Activity
CodeCombat is essentially an adventure/dungeon-delving -type game that teaches the basics of coding for kids.
Players can only control their characters by writing actual code using actual programming language, like JavaScript or Python. The steps to play CodeCombat are :
Getting Started
1. Head to the Website Open a web browser and go to https://codecombat.com/.
2. Create an Account (Optional) For free play, creating an account is not mandatory. However, creating a free account allows students to track their progress, earn rewards, and access aфditional features. To create an account, click on “Sign Up” in the top right corner.
Choosing a Learning Path
1. Explore Levels CodeCombat offers various learning paths depending on the student’s coding experience and desired focus. For Class 9 students, the following paths are good options :
Kithgard Dungeon This introductory path teaches basic programming concepts like variables, loops, and functions using Python.
Backwoods Forest This path builds on the basics and introduces conditional statements (if/else), arrays, and object properties using JavaScript.
2. Select a Level Within each path, there are multiple levels with increasing difficulty. Students can choose a level based on their comfort level.
Coding and Playing
1. Read the Level Introduction Each level provides instructions and explains the objective.
2. Write Code The game interface displays a code editor where students will write their code using Python or JavaScript (depending on the chosen path).
![]()
3. Run the Code Once the code is written, students can click the “Run” button to see how their code affects the game world. The game provides visual feedback on the success or errors in the code.
4. Experiment and Learn If the code doesn’t work as expected, students can analyze the feedback, make adjustments to their code, and try again. This experimentation process is key to learning and improving coding skills.
The post Introduction to Python Class 9 AI Questions and Answers appeared first on Learn CBSE.
from Learn CBSE https://ift.tt/pwCdEGg
via IFTTT
No comments:
Post a Comment