⚙️
Welcome to NCSOLVE — National Curriculum Solver of Learning Volume Environment! Explore Free NCERT Solutions, CBSE Sample Papers, and AI Tools! Empowering Education Worldwide with Advanced AI Technology! Access Cultural Insights, AI-Based Learning, and Free Hidden Books! Prepare for NEET, JEE, UPSC, and Other Competitive Exams with Exclusive Resources! Learn Smarter, Faster, and Better with NCSOLVE Today!

Python Programming Class 11 Questions and Answers - #NCSOLVE πŸ“š

0

These Class 11 AI Important Questions Chapter 3 Python Programming Class 11 Important Questions and Answers NCERT Solutions Pdf help in building a strong foundation in artificial intelligence.

Python Programming Class 11 Important Questions

Class 11 Python Programming Important Questions

Important Questions of Python Programming Class 11 – Class 11 Python Programming Important Questions

Python Programming Class 11 Very Short Answer Type Questions

Question 1.
For B=x: x is a natural number less than 8, write the set.
Answer:
B = 1,2,3,4,5,6,7

Question 2.
What are the types of matrix?
Answer:
Various types of matrix are row matrix, column matrix, square matrix, diagonal matrix, scalar matrix.

Question 3.
Write the types of operations that can be performed on a matrix?
Answer:
The various operations that are performed on a matrix are:
Transpose of a matrix, determinants of matrix. The other two matrices operations are trace and rank.

Question 4.
What is vector?
Answer:
A one dimensional array expressed in bracket is called a column vector or simply vector. For example v = (V1, V2, V3) Where v1 , v2, v3 are scalar values, often real values.

Python Programming Class 11 Questions and Answers

Question 5.
What is matrix?
Answer:
The two dimensional array-expression enclosed in brackets is called a matrix.

Question 6.
What kind of arithmetic operations you can do on a vector.
Answer:
Various arithmetic operations that can be done on a vector are:
Addition, subtraction, multiplication.

Question 7.
What are the operators used in relational algebra.
Answer:
Relational algebra consists of eight operators:
SELECT, PROJECT, JOIN, INTERSECT, UNION, DIFFERENCE, PRODUCT AND DIVIDE.

Question 8.
Calculate the mean of the following set data. S = {6,11,16,21,31}
Answer:
Mean of set S = 6+11+16+21+31 / 5 = 85 / 5 = 60.2

Question 9.
Five students marks in physics are given below :
18,10,13,10,17,11,9
Find the median value:
Answer:
Arranging the marks in order – 9,10,10,11,13,17,18

Question 10.
input() function accepts the value as string only. How can you convert string to int?
Answer:
Using int( ) function together with input(), we can convert string to int.

Python Programming Class 11 Questions and Answers

Question 11.
What are variables? What are the rules of declaring variables in Python?
Answer:
Named labels whose value can be used and processed during program run. Generally, keywords (list given above) are not used as variables. Variable names cannot start with digit and also it can’t contain any special characters except underscore.

Question 12.
What do you mean by type casting?
Answer:
A variable of particular datatype can be converted into another datatype using some functions. The explicit conversion of an operand to a specific type is called type casting.

Question 13.
“Python supports dynamic typing”, True or False. Justify your answer. True.
Answer:
A variable pointing to a value of certain data type can be made to point to a value/object of another data type. This is called Dynamic Typing. Python supports Dynamic Typing.

Question 14.
Name any four features of python language.
Answer:

  • High Level language
  • Interpreted Language
  • Free and Open Source
  • Platform Independent (Cross-Platform)

Question 15.
Give examples for keywords.
Answer:
and, as, continue, if, not try, del, pass

Question 16.
Expand CSV.
Answer:
Comma Separated Values

Question 17.
How do you read data from a CSV file into a Pandas DataFrame?
Answer:
import pandas as pd pd.read_csv(“filename.csv”)

Question 18.
What is Jupyter Notebook?
Answer:
Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and narrative text.

Question 19.
How do you install Jupyter Notebook?
Answer:
You can install Jupyter Notebook using Anaconda, which includes it by default, or by using pip with the command pip install notebook.

Python Programming Class 11 Questions and Answers

Question 20.
How do you start Jupyter Notebook after installation?
Answer:
Type jupyter notebook in your command prompt or terminal to start Jupyter Notebopk.

Question 21.
How do you create a new notebook in Jupyter Notebook?
Answer:
Click on the “New” button in the Jupyter Dashboard and select a kernel (e.g., Python 3) to create a new notebook.

Question 22.
How do you run code in a Jupyter Notebook?
Answer:
Press Shift + Enter or click the “Run” button to execute code cells in a Jupyter Notebook.

Python Programming Class 11 Short Answer Type Questions

Question 1.
Calculate the dot product of a=(-4,-9) and b=(-1,2) ?
Answer:
Using the formula for the dot product of two-dimensional vectors, a. b = a 1 b1 + a2 b2
we calculate the dot product to be
a.b = (-4)(-1)+(-9)(2) = 4-18 = -14

Question 2.
Python Programming Class 11 MCQ Online Test 4
Answer:
[A]=3 ×(6 × 9-2 X7)-5(4 X9-1 X7)+2(4 X 2-6 X1) = 3(54-14) – 5(36-7) + 2(8-6) = 3(40) – 5(29) + 2(2) = 21

Python Programming Class 11 Long Answer Type Questions

Question 1.
Calculate the mean of the following grouped data.

Class Frequency
10-12 3
8-10 4
4-6 5
2-4 6
Class Frequency

Answer:
Python Programming Class 11 Questions and Answers 1

Here n = Ξ£ f = 18
Ξ£ f . x = 112 Mean = Ξ£ f . x / n = 112 / 18 = 6.2

Question 2.
Following distribution table is given as :

Wage No of workers
0-10 10
10-20 20
20-30 30
30-40 40
40-50 45

Answer:
The median of the table is:

Wage No of workers (f) Cumulative frequency( cf)
0-10 10 10
10-20 20 30
20-30 30 40
30-40 40 70
40-50 45 115

N = 145
Median class is = size of item = (145+1) / 2=73
Median class =20-30
Now l 1=20, cf = 30, f = 30, n = 145, i = 10
Median M = 20 + \(\frac{\left(\frac{145}{2}-30\right)}{30}\) × 10 = 20+((72.5-30) / 30) × 10 = 20 + (42.5 / 30) \frac{\left(\frac{145}{2}-30\right)}{30} 10 = 20 + 14.16 = 34.16

Python Programming Class 11 Questions and Answers

Question 3.
Describe the data types supported by Python, providing relevant examples.
Answer:

Integer Stores whole number a=10
Floaing Point Stores numbers with fractional part x=5.5
Complex Stores a number having real and imaginary part num=a+bj
String immutable sequences

Stores text enclosed in single or double quote or triple quotes

name= “Ria”)
List mutable sequences

Stores list of comma separated values of any data type between square [ ]

Ist=[25,15.6, ” car “, “XY”]
Tuple Immutable sequence

Stores list of comma separated values of any data type between parentheses ()

tup = (11, 12.3, “abc”)
Dictionary Unordered set of comma-separated key:value pairs within braces {} dict= {1: “One”, 2: “Two”, 3: “Three”}

Question 4.
Define an operator and provide examples of different operators along with their functions.
Answer:
Operators are symbols or keywords that perform operations on operands to produce a result. Python supports a wide range of operators:

  • Arithmetic operators (+, -, *, /, %)
  • Relational operators (==, !=, , <=, >=)
  • Assignment operators (=,+=, -=)
  • Logical operators (and, or, not)
  • Bitwise operators (&, |, ∧, <>)
  • Identity operators (is, is not)
  • Membership operators (in, not in)

Question 5.
Write a Tipper program where the user inputs the total restaurant bill. The program should then display two amounts: 15 percent tip and 20 percent tip.
Answer:
Python Programming Class 11 Questions and Answers 2

Question 6.
Write a program to check whether the user is eligible for driving license or not.
Answer:
Python Programming Class 11 Questions and Answers 3

Question 7.
Your father always gives his car for service after 15000 km . Check whether his car needs, service or not. Read the kilometer reading from the user and give the output.
Answer:
Python Programming Class 11 Questions and Answers 4

Question 8.
Write a program to display the first ten even natural numbers (use for loop).
Answer:
Python Programming Class 11 Questions and Answers 5

Question 9.
Write a program to accept the Basic salary from the user and calculate the Net Salary.
Net Salary = Basic Salary + HRA + DA -PF
HRA = 30 % of Basic
DA=20 % of Basic
PF=12 % of Basic
Python Programming Class 11 Questions and Answers 6

Question 10.
Write a program to create series from an array in Python.
Answer:
Python Programming Class 11 Questions and Answers 7

Question 11.
Consider the following admission.csv and answer the following questions:
Answer:
immmmmmmmmmmmm
a. Create a dataframe from the admission.csy
import pandas as pd
import csv
df=pd.read_csv(“admission.csv”)
print(df)
b. Display first 3 rows of the dataframe
print(df.head(3))
c. Display the details of Ravi
print(df. loc[‘Ravi’])
d. Display the total number of rows and columns in the data frame print(df.shape)
e. Display the column “Gender”
print(df[‘Gender’])

Case-Based Questions

Question 1.
Madhu is confused on uses of the matrices AI help her in understanding the same.
Answer:
In machine learning matrices are used for computing. It help in :

  • Sales forecasting and predicting price
  • In processing images
  • In recommendation systems
  • In processing natural language or NLP

Python Programming Class 11 Questions and Answers

Question 2.
Shyama is little bit confused while evaluating transpose and determinants of a matrix. Help her in understanding the concepts with an example.
Answer:
Transpose of a matrix. When a matrix obtained by a interchanging its rows and column then that matrix is called a transpose of a matrix (A) and is denoted by AT.

Python Programming Class 11 MCQ Online Test 1

Determinants of a matrix : Determinant is a scalar value it may be either a real number of a complex number bht it is a unique number. For example

Python Programming Class 11 MCQ Online Test 2

Question 3.
Jagdish is watching that Shyama was trying to understand the determinants and transpose of a matrix now he want to discuss her about inverse of a matrix. Suggest a way to help them.
Answer:
Inverse of a matrix is the process of finding another matrix, which when multiplied with the original matrix gives an identity matrix. It is denoted by A-1. For example

Python Programming Class 11 MCQ Online Test 3

Question 4.
Help Priya to differentiate the given information into various datatypes of Python. Name of the student, email id, student id, marks in 5 subjects which can be changed at any point, 3 extra subjects chosen which cannot be changed later.
Answer:
The different datatypes of Python for the given information are:

  • Name of the student-String type
  • Email id-String type
  • Student id-Integer type
  • Marks in 5 subjects which can be changed at any point-List type.
  • Extra 3 subjects which cannot be changed later-Tuple type.

Question 5.
For any analysis to be done, a huge amount of data needs to be collected and stored in a proper format. Rohan has stored the information in a delimited file that stores tabular data which is separated by comma. Which type of file is Rohan using?
Answer:
CSV file (Comma Separated Values)

Question 6.
Athrav is confused about the different libraries of Python. Help him choose the correct library for the following tasks. a. Data manipulation and aggregation functionalities b . Numerical computing c. Mathematical operations like square root, cosine values d. Machine learning and statistical modeling
Answer:
a. pandas
b. numpy
c. math
d. scikit-learn

Python Programming Class 11 Questions and Answers

Question 7.
Rohit wants to input the data about the runs scored by his 50 classmates. Which is the most appropriate loop to be used in this case?
Answer:
‘for’ loop

Scenario Based Question Answer:

Scenario: 1.

Question:
As a beginner in Python programming, you are interested in using Jupyter Notebook for your data science projects. Explain the steps you would follow to install and use Jupyter Notebook on your computer.
Answer:
To install and use Jupyter Notebook for your Python projects, follow these steps:
Installation:

If you’re using Anaconda, Jupyter Notebook comes pre-installed. Simply launch Anaconda Navigator and click on the Jupyter Notebook icon.
If you prefer using pip, open your command prompt or terminal and type pip install notebook.
Once installed, you can start Jupyter Notebook by typing jupyter notebook in your command prompt or terminal.

Opening Jupyter Notebook:

After starting Jupyter Notebook, a new browser window or tab will open showing the Jupyter Dashboard.
Here, you can navigate to the directory where you want to create or open your Python notebooks.

Creating a New Notebook:

Click on the “New” button on the top right corner and select “Python 3” (or any other kernel you need) to create a new notebook.
This will open a new tab where you can start typing your Python code.

Writing and Running Code:

In the notebook, you can write Python code in cells. To execute a cell, press Shift + Enter or click the “Run” button in the toolbar.
Output will appear below each cell where you’ve written code.

Saving and Closing:

To save your work, click on the “File” menu and select “Save and Checkpoint”, or use Ctrl + S (Cmd +S on macOS).
When you’re done, you can close the notebook by clicking on the “Quit” button in the Jupyter Dashboard or by closing the browser tab.

Python Programming Class 11 Notes

Python Overview:

  • Python is a general-purpose, high-level programming language created by Guido van Rossum in 1991, named after Monty Python.
  • Features: High-level, interpreted, free, open-source, platform-independent, easy to use and learn, supports ASCII and UNICODE characters.

Python Editors-There are various editors and Integrated Development Environments (IDEs) that you can use to work with Python. Some popular options are PyCharm, Spyder, Jupyter Notebook, IDLE etc.

Tokens in Python:
Tokens are the smallest units recognized by the Python interpreter, including keywords, identifiers, literals, operators, and punctuators.

Control Flow Statements:
Includes selection statements (‘if’, if..else’) and looping statements (‘for’, ‘while’).

Libraries in Python:

  • NumPy: Used for numerical computing with arrays and matrices.
  • Pandas: Used for data manipulation and analysis with data frames.
  • Scikit-learn: Provides tools for machine learning tasks like classification, regression, and clustering.

Python Programming Class 11 Questions and Answers

Machine Learning with Scikit-learn:

Includes loading datasets like Iris, splitting data into training and test sets, using classifiers like K-Nearest Neighbors (KNeighborsClassifier), and evaluating model accuracy.

Identifier-An identifier is a name used to identify a variable, function, class, module or other object. Generally, keywords (list given above) are not used as variables. Identifiers cannot start with digit and also it can’t contain any special characters except underscore.

Literals- Literals are the raw data values that are explicitly specified in a program. Different types of Literals in Python are String Literal, Numeric Literal(Numbers), Boolean Literal(True & False), Special Literal (None) and Literal Collections.

Operators-Operators are symbols or keywords that perform operations on operands to produce a result. Python supports a wide range of operators:

  • Arithmetic operators (+, -, *, /, %)
  • Relational operators (==, !=, <, >, <=, >=)
  • Assignment operators (=,+=,-=)
  • Logical operators (and, or, not)
  • Bitwise operators ( &, |, ∧, <<, >>)
  • Identity operators (is, is not)
  • Membership operators (in, not in)

Punctuators: Common punctuators in Python include:
: () [] {}, ; , ‘” ” “/ \ & @ ! ? | ~etc.

Python Programming Class 11 Questions and Answers

Looping Statements-Looping statements in programming languages allow you to execute a block of code repeatedly. In Python, there are mainly two types of looping statements: for loop and while loop.

Series-A Series is a one-dimensional array containing a sequence of values of any data type (int, float, list, string, etc.) which by default have numeric data labels starting from zero. The data label associated with a particular value is called its index.

The post Python Programming Class 11 Questions and Answers appeared first on Learn CBSE.



πŸ“š NCsolve - Your Global Education Partner 🌍

Empowering Students with AI-Driven Learning Solutions

Welcome to NCsolve — your trusted educational platform designed to support students worldwide. Whether you're preparing for Class 10, Class 11, or Class 12, NCsolve offers a wide range of learning resources powered by AI Education.

Our platform is committed to providing detailed solutions, effective study techniques, and reliable content to help you achieve academic success. With our AI-driven tools, you can now access personalized study guides, practice tests, and interactive learning experiences from anywhere in the world.

πŸ”Ž Why Choose NCsolve?

At NCsolve, we believe in smart learning. Our platform offers:

  • ✅ AI-powered solutions for faster and accurate learning.
  • ✅ Step-by-step NCERT Solutions for all subjects.
  • ✅ Access to Sample Papers and Previous Year Questions.
  • ✅ Detailed explanations to strengthen your concepts.
  • ✅ Regular updates on exams, syllabus changes, and study tips.
  • ✅ Support for students worldwide with multi-language content.

🌐 Explore Our Websites:

πŸ”Ή ncsolve.blogspot.com
πŸ”Ή ncsolve-global.blogspot.com
πŸ”Ή edu-ai.blogspot.com

πŸ“² Connect With Us:

πŸ‘ Facebook: NCsolve
πŸ“§ Email: ncsolve@yopmail.com

#NCsolve #EducationForAll #AIeducation #WorldWideLearning #Class10 #Class11 #Class12 #BoardExams #StudySmart #CBSE #ICSE #SamplePapers #NCERTSolutions #ExamTips #SuccessWithNCsolve #GlobalEducation

Post a Comment

0Comments

πŸ˜‡ WHAT'S YOUR DOUBT DEAR ☕️

🌎 YOU'RE BEST πŸ†

Post a Comment (0)