These Class 10 AI Important Questions Chapter 3 Advanced Python Class 10 Important Questions and Answers NCERT Solutions Pdf help in building a strong foundation in artificial intelligence.
Advanced Python Class 10 Important Questions
Class 10 AI Advanced Python Important Questions
Important Questions of Advanced Python Class 10 – Class 10 Advanced Python Important Questions
Advanced Python Class 10 Subjective Questions
Question 1.
What is Jupyter Notebook?
Answer:
Jupyter Notebook is an open-source web application that allows users to create and share interactive documents containing live code, equations, visualizations, and text. It’s particularly popular in AI-related projects and primarily uses Python, although it supports other programming languages too.
Question 2.
How to access Jupyter Notebook?
Answer:
To access Jupyter Notebook:
- Install Anaconda.
- Open Anaconda Navigator.
- Launch Jupyter Notebook from the Navigator interface or by using the Anaconda Prompt with the command jupyter notebook.
Question 3.
What is Virtual Environment?
Answer:
A virtual environment in Python is a self-contained directory that houses a Python interpreter and its own set of libraries and dependencies. It allows developers to work on multiple projects with different dependencies without conflicts.
Question 4.
What are the key features of Python? Mention various applications along with it.
Answer:
Refer to text on page 102 (Features of Python, Python Applications).
Question 5.
What is a Jupyter Notebook ?
Answer:
Refer to text on page 100 (Jupyter Notebook).
Question 6.
How can install jupyter notebook in anaconda prompt?
Answer:
Refer to text on page 100 (Installing Jupyter Using Anaconda)
Question 7.
Why do we need to install a kernel before running jupyter notebook?
Answer:
We need to install a kernel before running Jupyter Notebook because:
- Language Execution It allows Jupyter to execute code in a specific programming language.
- Runtime Environment The kernel provides the necessary environment to run and manage code.
- Interactive Computing It facilitates communication between the notebook interface and the code execution process.
- Output Handling The kernel processes code execution and returns outputs, including results and error messages, to the notebook.
Advanced Python Class 10 Very Short Answer Type Questions
Question 1.
What is the output of print(type(25))?
Answer:
The output is <class ‘int’>.
Question 2.
Give one example of variable.
Answer:
age = 25, where age is the variable storing the value 25 .
Question 3.
Define Pandas libraries.
Answer:
Pandas is an open-source data manipulation and analysis library for Python. It provides data structures like DataFrame for efficient data handling.
Question 4.
Define operator precedence.
Answer:
Operator precedence determines the order in which operators are evaluated in an expression. It ensures that certain operators are evaluated before others.
Question 5.
Give one example of each of the following:
(a) Unary operator
(b) Comparison operator
Answer:
(a) Unary operator: ∼ x (negation)
(b) Comparison operator: = (equality)
Question 6.
Mention any one feature of List in Python.
Answer:
Lists in Python are versatile and can store elements of different data types in an ordered and mutable sequence.
Question 7.
What do you understand by iteration in programming?
Answer:
Iteration is the process of repeatedly executing a set of statements or a block of code.
Question 8.
Give any two features of OpenCV.
Answer:
Two features include image recognition and object detection.
Question 9.
Name the operator used for the following:
(a) To assign a value to a variable
(b) That returns True or False.
Answer:
(a) =
(b) Comparison operators, such as == or ! =
Question 10.
What is the minimum number of iterations that while loop could make?
Answer:
while loop could make minimum 0 iteration.
Advanced Python Class 10 Short Answer Type Questions
Question 1.
Identify and correct the error(s) from the given below variables.
(i) STD
(ii) 5STD
(iii) D
(iv) (Marks)
Answer:
(i) Error STD – – is not allowed. The correct form is STD
(ii) Error 5STD First character must be alphabet. The correct form is STD5.
(iii) Error D$$ is not allowed. The correct form is D.
(iv) Error (Marks) Brackets are not allowed. The correct form is Marks.
Question 2.
Differentiate between identifier and keyword.
Answer:
Differences between identifier and keyword are as follows
Identifier | Keyword |
Identifier consists any combination of letters, numbers and underscores. | Keyword must consist only letters. |
It allows both uppercase and lowercase. | It allows only lowercase. |
e.g. x, sum_5,_mul etc. | e.g. finally, continue, yield etc. |
Question 3.
What is the difference between statement and expression?
Answer:
Differences between statement and expression are as follows
Statement | Expression |
A statement is a complete line of code that performs some action. | An expression is any section of the code that evaluates to a value. |
Statements can only be combined vertically by writing one after another or with block constructs. | Expressions can be combined horizontally into larger expressions using operators. |
Question 4.
Shreya is programming in Python and writing a following code. But she found an error, what is the reason?
a = 10
b = 20
c = a + b
print (“The output is : ” , c)
Answer:
The above code is identation error and correct code is
a = 10
b = 20
c = a + b
print (“The output is : “, c)
Question 5.
Find the syntax error in the following program and underline after correct them.
w = 90 ;
while (w>60)
pringt (w)
w = w-50
Answer:
Correct code is
Question 6.
Construct logical expressions to represent the following conditions.
(i) Weight is greater than or equal to 115 but less than 125.
(ii) Donation is in the range of 4000-5000 or Guest is 1.
Answer:
(i) (weight >=115 and weight <125 )
(ii) ((Donation >=4000 and Donation <=5000 ) or Guest ==1 )
Question 7.
Write a Python program to calculate simple interest and display it.
Answer:
Output
Enter the principal : 5000
Enter rate of interest : 10
Enter time: 2
The simple interest is 1000.0
Question 8
What is a Python package?
Answer:
A Python package is a way of organising related modules into a single directory hierarchy. It helps in structuring Python’s module namespace and avoids naming conflicts. Packages are directories containing module files and an __init__py file. They provide a means of creating a hierarchical structure to organise and distribute Python code.
Advanced Python Class 10 Long Answer Type Questions
Question 1.
What do you understand by string literals? Explain.
Answer:
The literal which is stored in a variable within single quotation mark or double quotation marks is called string literal. These represent a sequence of zero or more characters enclosed by double quotes. It can also include blank spaces.
Some valid string constants are
Some Invalid string constants are
Neha – Not enclosed in double or single quotes
“Hello” – Number of quotes must be even either double or single.
There are two types of strings supported in Python:
(a) Single Line String Strings that are terminated within a single line are known as single line strings.
e.g. >>> value = ‘Arihant’
(b) Multiline String A piece of text that is spread along multiple lines is known as multiple line string.
There are two ways to create multiline strings:
(I) Adding backslash at the end of each line
(II) Using triple quotation marks
Question 2.
Write a Python program with output to convert the centimeter value into meter and kilometer.
Answer:
Output
Enter value in centimeters: 5000
Length in meter = 50.0 m
Length in Kilometer = 0.05 km
Question 3.
An electricity board charges according to the following rules.
For the first 100 units – 40 P per unit
For the next 200 units – 50 P per unit
Beyond 300 units -60 P per unit
All users have to pay meter charge also, which is ₹ 50. Write a program to read the number of units consumed and print out the charges.
Answer:
Output
Enter the number of units consumed: 125
The charges is : 102.5
Question 4.
Write a program to check whether a number is prime or not.
Answer:
Output
Enter the number : 67
n = 67
67 is a prime number
Question 5.
Write a program in Python to accept monthly salary from the user, find and display income tax with the help of following rules.
Monthly Salary | Income Tax |
9000 or more | 40 % of monthly salary |
7500-8999 | 30 % of monthly salary |
7499 or less | 20 % of monthly salary |
Answer:
Output
Enter monthly salary: 15000
Income tax is 6000.0
Question 6.
Write a Python program which enter the cost price and selling price of an item and find profit or loss.
Answer:
Output
Please Enter the Cost Price of an Item: 15000
Please Enter the Selling Price of an Item: 17500
Total Profit = 2500.0
The post Advanced Python Class 10 Questions and Answers appeared first on Learn CBSE.