Encoding Schemes and Number System Class 11 NCERT Solutions

Teachers and Examiners (CBSESkillEduction) collaborated to create the Encoding Schemes and Number System Class 11 NCERT Solutions. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Encoding Schemes and Number System Class 11 NCERT Solutions

1. Write base values of binary, octal and hexadecimal number system.

Answer –
Binary – 2
Octal – 8
Hexadecimal – 16

2. Give full form of ASCII and ISCII.

Answer –
ASCII – American Standard Code for Information Interchange
ISCII – Indian Script Code for Information Interchange

3. Try the following conversions:

Answer –
i. (514)8 = (332)10
ii. (220)8 = (10010000)2
iii. (76F)16 = (1903)10
iv. (4D9)16 = (1241)10
v. (11001010)2 = (202)10
vi. (1010111)2 = (87)10

4. Do the following conversions from decimal number to other number systems.

Answer –
i. (54)10 = (110110)2
ii. (120)10 = (1111000)2
iii. (76)10 = (114)8
iv. (889)10 = (1571)8
v. (789)10 = (315)16
vi. (108)10 = (6C)16

5. Express the following octal numbers into their equivalent decimal numbers.

Answer –
i. 145 = (101)10
ii. 6760 = (2568)10
iii. 455 = (301)10
iv. 10.75 = (8.95312)10

6. Express the following decimal numbers into hexadecimal numbers.

Answer –
i. 548 = (224)16
ii. 4052 = (FD4)16
iii. 58 = (3A)16
iv. 100.25 = (64.4)16

7. Express the following hexadecimal numbers into equivalent decimal numbers.

Answer –
i. 4A2 = (1186)10
ii. 9E1A = (40474)10
iii. 6BD = (1725)10
iv. 6C.34 = (108.20312)10

8. Convert the following binary numbers into octal and hexadecimal numbers.

Answer –
i. 1110001000 = Octal – (1610)8 Hexadecimal – (388)16
ii. 110110101 = Octal – (665)8 Hexadecimal – (1B5)16
iii. 1010100 = Octal – (124)8 Hexadecimal – (54)16
iv. 1010.1001 = Octal – (12.44)8 Hexadecimal – (A.9)16

9. Write binary equivalent of the following octal numbers.

Answer –
i. 2306 = (10011000110)2
ii. 5610 = (101110001000)2
iii. 742 = (111100010)2
iv. 65.203 = (110101.010000011)2

10. Write binary representation of the following hexadecimal numbers.

Answer –
i. 4026 = (100000000100110)2
ii. BCA1 = (1011110010100001)2
iii. 98E = (100110001110)2
iv. 132.45 = (100110010.01000101)2

11. How does computer understand the following text?
(hint: 7 bit ASCII code).

Answer –
i. HOTS

HOTS
ASCII Code72798483
Binary Code1001000100111110101001010011

ii. Main

MAIN
ASCII Code7797105110
Binary Code
1001101110000111010011101110

iii. CaSe

CASE
ASCII Code679783101
Binary Code1000011110000110100111100101

12. The hexadecimal number system uses 16 literals (0–9, A–F). Write down its base value.

Answer – 16

13. Let X be a number system having B symbols only. Write down the base value of this number system.

Answer – If X is a number system with B symbols, then B will be the basic value of that system.

14. Write the equivalent hexadecimal and binary values for each character of the phrase given below.
‘‘ हम सब एक”

Answer –

Hexadecimal0939092E0938092C
090F
0915
Binary Code100100111001100100101110100100111000100100101100100100001111100100010101

15. What is the advantage of preparing a digital content in Indian language using UNICODE font?

Answer – The biggest benefit of adopting Unicode for creating digital content in Indian is that we don’t need to have that font installed on our machine in order to render the language characters.

16. Explore and list the steps required to type in an Indian language using UNICODE.

Answer –
Step 1: Write an character in Indian Language
Step 2: Every character having UNICODE, Machine will read the code automatically
Step 3: After reading the code by machine, Machine will convert the code into Binary Language

17. Encode the word ‘COMPUTER’ using ASCII and convert the encode value into binary values.

Answer –

COMPUTER
ASCII Code067079077080085084069082
Binary Code0100001101001111010011010101000001010101010101000100010101010010
Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

Introduction to Problem Solving Class 11 MCQ

introduction to problem solving class 11 mcq

Teachers and Examiners (CBSESkillEduction) collaborated to create the Introduction to Problem Solving Class 11 MCQ. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Introduction to Problem Solving Class 11 MCQ

1. Computers cannot solve problems on their own. We must provide clear, step-by-step directions on how to solve the issue, this solving technique is known as ____________.
a. Problem Solving 
b. Problem Addressing
c. Problem Analysis
d. None of the above

Show Answer ⟶
a. Problem Solving

2. ___________ is the process of identifying a problem, developing an algorithm for the identified problem and finally implementing the algorithm to develop a computer program.
a. Problem Solving 
b. Problem Addressing
c. Problem Analysis
d. None of the above

Show Answer ⟶
a. Problem Solving

3. It is essential to device a solution before writing a program code for a given problem. The solution is represented in natural language and is called an ___________.
a. Problem
b. Algorithm 
c. Problem Analysis
d. None of the above

Show Answer ⟶
b. Algorithm

4. After finalizing the algorithm, we need to convert the algorithm into the_________.
a. Format which can be understood by the computer
b. High level programming language
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

Introduction to Problem Solving Class 11 MCQ

5. What are the different type of testing.
a. Component testing
b. Integration testing
c. System testing & Acceptance testing
d. All of the above 

Show Answer ⟶
d. All of the above

6. The developed programme needs to pass different parameter __________. The programme needs to fulfil the user’s requirements. It must respond in the anticipated amount of time.
a. Method
b. Testing 
c. Error
d. None of the above

Show Answer ⟶
b. Testing

7. To complete each activity in a computer, we follow a sequence of steps. This sequence of steps is known as ________.
a. Problem
b. Algorithm 
c. Problem Analysis
d. None of the above

Show Answer ⟶
b. Algorithm

8. ____________ is the act of locating and fixing problems in software code that could lead to unexpected behavior or crashes. These errors are sometimes referred to as “bugs.”
a. Algorithm
b. Problem Solving
c. Debugging 
d. All of the above

Show Answer ⟶
c. Debugging

9. Why do we need an Algorithm?
a. Accuracy
b. Minimized mistakes
c. Best possible solution
d. All of the above 

Show Answer ⟶
d. All of the above

Introduction to Problem Solving Class 11 MCQ

10. Writing an algorithm is mostly considered as a ________.
a. First step of programming 
b. Second step of programming
c. Third step of programming
d. None of the above

Show Answer ⟶
a. First step of programming

11. Purpose of using algorithm?
a. Increase the reliability
b. Accuracy of the program
c. Efficiency of obtaining solutions
d. All of the above 

Show Answer ⟶
d. All of the above

12. Characteristics of a good algorithm.
a. Precision & Uniqueness
b. Finiteness
c. Input & Output
d. All of the above 

Show Answer ⟶
d. All of the above

13. Before implementing algorithm, the programmer should __________ first.
a. Analyze the problem
b. Identify the problem
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

14. A __________ is a visual representation of an algorithm.
a. Flowchart 
b. Pseudocode
c. Algorithm
d. None of the above

Show Answer ⟶
a. Flowchart

Introduction to Problem Solving Class 11 MCQ

15. A flowchart is a diagram made up of __________.
a. Boxes
b. Diamonds
c. Shapes
d. All of the above 

Show Answer ⟶
d. All of the above

16. Start/End also called _________ symbol, it indicates where the flow starts and ends.
a. Terminator 
b. Decision
c. Input / Output
d. Arrow

Show Answer ⟶
a. Terminator

17. Process is also called ________, it represents a process, action, or a single step.
a. Terminator
b. Action Symbol 
c. Decision
d. Input/ Output

Show Answer ⟶
b. Action Symbol

18. A __________ or branching point, usually a yes/no or true/ false question is asked, and based on the answer, the path gets split into two branches.
a. Terminator
b. Action Symbol
c. Decision 
d. Input/ Output

Show Answer ⟶
c. Decision

19. _________ is also called data symbol, this parallelogram shape is used to input or output data.
a. Terminator
b. Action Symbol
c. Decision
d. Input/ Output 

Show Answer ⟶
d. Input/ Output

Introduction to Problem Solving Class 11 MCQ

20. ___________ connector to show order of flow between shapes.
a. Terminator
b. Action Symbol
c. Decision
d. Arrow 

Show Answer ⟶
d. Arrow

21. A ___________ is another way of representing an algorithm. It is considered as a non-formal language that helps programmers to write algorithm.
a. Flowchart
b. Pseudocode 
c. Algorithm
d. None of the above

Show Answer ⟶
b. Pseudocode

22. The word “pseudocode” means ___________.
a. Not real code 
b. Real code
c. Temporary code
d. None of the above

Show Answer ⟶
a. Not real code

23. It is necessary to run different input values through the algorithm’s phases in order to verify. This process of taking an input and running it through all of the algorithm’s steps is commonly referred to as a _______.
a. Code
b. Dry run 
c. Method
d. None of the above

Show Answer ⟶
b. Dry run

24. Dry run will help us to __________.
a. Identify any incorrect steps in the algorithm
b. Figure out missing details or specifics in the algorithm
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

Introduction to Problem Solving Class 11 MCQ

25. algorithms can be ___________ on the basis of the amount of processing time they need to run and the amount of memory that is needed to execute the algorithm.
a. Compared
b. Analyzed
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

26. ___________ is the set of rules or grammar that governs the formulation of the statements in the language, such as spellings, order of words, punctuation, etc.
a. Analyzed
b. Syntax 
c. Code
d. None of the above

Show Answer ⟶
b. Syntax

27. Programs written using ________ are directly understood by the computer hardware, but they are difficult to deal with and comprehend by humans.
a. High Level Language
b. Binary Digit 
c. 4GL Language
d. None of the above

Show Answer ⟶
b. Binary Digit

28. A program written in a high-level language is called ___________.
a. Source code 
b. Object
c. Machine language
d. None of the above

Show Answer ⟶
a. Source code

29. What type of problems are solved by computer.
a. Easy problem
b. Complex problem
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

Introduction to Problem Solving Class 11 MCQ

30. The basic idea of solving a complex problem by decomposition is to __________.
a. Decompose
b. Break down
c. Complex problem into smaller sub problems
d. All of the above 

Show Answer ⟶
d. All of the above

31. An algorithm is defined as a _________ procedure designed to perform an operation which will lead to the desired result, if followed correctly.
a. Reverse procedure
b. Step-by-step procedure 
c. Random procedure
d. None of the above

Show Answer ⟶
b. Step-by-step procedure

32. Algorithms have a definite ________ and a definite ________, and a finite number of steps.
a. Middle & End
b. Beginning & End 
c. Beginning & Middle
d. None of the above

Show Answer ⟶
b. Beginning & End

33. A good algorithm, which is __________, receives input and produces an output.
a. Precise
b. Unique
c. Finite
d. All of the above 

Show Answer ⟶
d. All of the above

34. In order to write effective algorithms we need to identify the__________ to be followed and the desired output.
a. Input
b. Process
c. Both a) and b) 
d. None of the above

Show Answer ⟶
c. Both a) and b)

Introduction to Problem Solving Class 11 MCQ

35. A flowchart is a type of diagram that represents the algorithm graphically using boxes of various kinds, in an order connected by arrows.
a. Flowchart 
b. Algorithm
c. Pseudocode
d. None of the above

Show Answer ⟶
a. Flowchart

36. An _________ where all the steps are executed one after the other is said to execute in sequence.
a. Flowchart
b. Algorithm 
c. Pseudocode
d. None of the above

Show Answer ⟶
b. Algorithm

37. _________ making involves selection of one of the alternatives based on outcome of a condition.
a. Terminator
b. Action Symbol
c. Decision 
d. Arrow

Show Answer ⟶
c. Decision

38. An _________ may have a certain set of steps, which are repeating for a finite number of times, such an algorithm is said to be iterative.
a. Flowchart
b. Algorithm 
c. Pseudocode
d. None of the above

Show Answer ⟶
b. Algorithm

39. There can be __________ approach to solve a problem and hence we can have more than one algorithm for a particular problem.
a. Only one
b. More than one 
c. No approach
d. None of the above

Show Answer ⟶
b. More than one

Introduction to Problem Solving Class 11 MCQ

40. The choice of __________ should be made on the basis of time and space complexity.
a. Flowchart
b. Algorithm 
c. Pseudocode
d. None of the above

Show Answer ⟶
b. Algorithm
Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

Emerging Trends Class 11 Questions and Answers

emerging trends class 11 questions and answers

Teachers and Examiners (CBSESkillEduction) collaborated to create the Emerging Trends Class 11 Questions and Answers. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Emerging Trends Class 11 Questions and Answers

1. List some of the cloud-based services that you are using at present.
Answer – Some of the cloud based services are
a. Infrastructure as a Service (IaaS) – The IaaS providers can offer different kinds of computing infrastructure because of its speed of deployment, example Amazon Web Services, Google Compute Engine and Microsoft Azure.

b. Platform as a Service (PaaS) – The facility provided by the cloud, where a user can install and execute an application without worrying about the underlying infrastructure and their setup. example, Database Server, Web Server, Programming language execution environment.

c. Software as a Service (SaaS) – SaaS provides on-demand access to application software, usually requiring a licensing or subscription by the user. example, Google Doc, Microsoft Office 365, Drop Box etc.

Emerging Trends Class 11 Questions and Answers

2. What do you understand by the Internet of Things? List some of its potential applications.
Answer – The ‘Internet of Things’ is a network of devices that have an embedded hardware and software to communicate (connect and exchange data) with other devices on the same network.
Some of the potential applications of IoT are –
a. Smart Door Locks
b. Medical Sensors
c. Smart Mobiles
d. Smart Refrigerators
e. Smartwatches
f. Smart Fire alarms

3. Write short notes on the following:
a) Cloud Computing
b) Big data and its Characteristics
Answer –
a) Cloud Computing – In the field of information technology, cloud computing is a new trend where computer-based services are supplied via the Internet or the cloud and are accessible to the user from any location using any device. The services include hardware (servers), databases, storage, and software.

b) Big data and its Characteristics – Big data is a collection of information from numerous sources, and it is frequently defined by five factors: volume, value, diversity, velocity, and veracity.

Emerging Trends Class 11 Questions and Answers

4. Explain the following along with their applications.
a) Artificial Intelligence
b) Machine Learning
Answer –
a) Artificial Intelligence – Artificial intelligence (AI) is the simulation of human intelligence in devices that have been designed to behave and think like humans. The statement can also be used to refer to any computer that demonstrates characteristics of the human intellect, like learning and problem-solving.

b) Machine Learning – Machine Learning is a subfield of Artificial Intelligence to mimic intelligent human behaviour. Similar to how people approach problem-solving, artificial intelligence systems are employed to carry out complex jobs.

Emerging Trends Class 11 Questions and Answers

5. Differentiate between cloud computing and grid computing with suitable examples.
Answer – Because of cloud computing, the system is always accessible. In order to provide a setting where several computers can work together to complete a task as needed, grid computing refers to a network of the same or various types of computers. Also capable of working alone is each computer.

Example of Cloud computing – Gmail, Dropbox, Facebook, Amazon Web Services etc.
Example of Grid Computing – Online Games, Entertainment Industry, Database, WebLogic Application Servers etc.

6. Justify the following statement:
“Storage of data is cost-effective and time saving in cloud computing.”
Answer – Because the cloud vendor manages everything, using cloud storage is both time and money efficient. We don’t need to spend money on hardware resources, power, or support to manage and store data.

7. What is on-demand service? How it is provided in cloud computing?
Answer – On-demand self-service, customers can purchase, customize, and install apps via cloud service catalogues without the help of a skilled professional. The resources could be kept up by the user’s company or supplied by a cloud service provider.

Emerging Trends Class 11 Questions and Answers

8. Write examples of the following:
a) Government provided cloud computing platform
b) Large scale private cloud service providers and the services they provide
Answer –
a) Government provided cloud computing platform – The Government of India’s cloud computing project seeks to maximize government ICT spending while accelerating the delivery of e-services across the nation. Example, AWS and IBM.

b) Large scale private cloud service providers and the services they provide – An industry leader, Amazon Web Services (AWS) enables businesses all over the world to fully or partially create their digital infrastructure using the cloud.

Emerging Trends Class 11 Questions and Answers

9. A company interested in cloud computing is looking for a provider who offers a set of basic services, such as virtual server provisioning and on demand storage that can be combined into a platform for deploying and running customized applications.
What type of cloud computing model fits these requirements?
a) Platform as a Service
b) Software as a Service
c) Application as a Service
d) Infrastructure as a Service
Answer –
d) Infrastructure as a Service

10. If the government plans to make a smart school by applying IoT concepts, how can each of the following be implemented in order to transform a school into IoT-enabled smart school?
a) e-textbooks
b) Smart boards
c) Online Tests
d) Wifi sensors on classrooms doors
e) Sensors in buses to monitor their location
f) Wearables (watches or smart belts) for attendance monitoring.

Answer –
a) e-textbooks – E-textbooks are available through online libraries or other web services.
b) Smart boards – In the class smart boards can helps to diliver the content to the students and helps to improve teaching learning process
c) Online Tests – IoT should be used to centralize the test and track student progress.
d) WIFI sensors on classrooms doors – Wi-Fi sensors may be used to keep an eye on the kids. These sensors can also record the students’ attendance.
e) Sensors in buses to monitor their location –The school and parents can obtain visibility, control, and safety into the GPS location of the school buses as well as arrival and departure times at each stop along the route.

f) Wearables (watches or smart belts) for attendance monitoring – Utilizing a wearable gadget to take attendance will make it easier to track students’ attendance.

Emerging Trends Class 11 Questions and Answers

11. Five friends plan to try a startup. However, they have a limited budget and limited computer infrastructure. How can they avail the benefits of cloud services to launch their startup?
Answer – They require servers, a huge amount of storage, and sophisticated infrastructure to deploy a number of applications in order to establish their firm. These are accessible through cloud computing infrastructure as a service (IaaS) providers like Amazon Web Services (AWS), Microsoft Azure, and others.

12. Governments provide various scholarships to students of different classes. Prepare a report on how blockchain technology can be used to promote accountability, transparency and efficiency in distribution of scholarships?
Answer – The blockchain technology is based on the idea of shared, decentralized databases that are replicated across all computers. Therefore, if the government makes this technology available, all scholarship applicants will have access to read the applications of other applicants.

Emerging Trends Class 11 Questions and Answers

13. How are IoT and WoT related?
Answer – Both IoT and WoT can be used to connect to a network and communicate with several devices. They can act as a bridge between other devices, allowing communication through an app, a web service, or any other network-capable device.

14. Match the columns:
You got a reminder to take medication – Smart Health
You got an SMS alert that you forgot to lock the door – Home Automation
You got an SMS alert that parking space is available near your block – Smart Parking
You turned off your LED TV from your wrist watch – Smart Wearable

Computer

Emerging Trends Class 11 MCQ

emerging trends class 11 mcq

Teachers and Examiners (CBSESkillEduction) collaborated to create the Emerging Trends Class 11 MCQ. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Emerging Trends Class 11 MCQ

1. ___________ are the state-of-the-art technologies, which gain popularity and set a new trend among users.
a. Emerging trends 
b. Popular trends
c. Trends
d. None of the above

Show Answer ⟶
a. Emerging trends

2. Example of Artificial Intelligence
a. Google Now
b. Cortana
c. Alexa
d. All of the above 

Show Answer ⟶
d. All of the above

3. __________ is a subsystem of Artificial Intelligence, wherein computers have the ability to learn from data using statistical techniques, without being explicitly programmed by a human being.
a. Artificial Intelligence
b. Machine Learning 
c. Data Science
d. None of the above

Show Answer ⟶
b. Machine Learning

4. Algorithms that use data to learn on their own and make predictions is known as ___________.
a. Artificial
b. Models 
c. Data
d. All of the above

Show Answer ⟶
b. Models

Emerging Trends Class 11 MCQ

5. Spell checking features are examples of ___________.
a. Data Science
b. Nero Science
c. Natural Language Processing 
d. All of the above

Show Answer ⟶
c. Natural Language Processing

6. ___________ deals with the interaction between human and computers using human spoken languages, such as Hindi, English, etc.
a. Data Science
b. Nero Science
c. Natural Language Processing 
d. All of the above

Show Answer ⟶
c. Natural Language Processing

7. ___________ allow us to visualize, feel and react by stimulating our senses.
a. Immersive experiences 
b. Augmented Reality
c. Virtual Reality
d. None of the above

Show Answer ⟶
a. Immersive experiences

8. Immersive experiences have been used in the field of __________.
a. Training
b. Driving Simulators
c. Flight Simulator
d. All of the above 

Show Answer ⟶
d. All of the above

9. _____________ is a three-dimensional, computer-generated situation that simulates the real world.
a. Immersive experiences
b. Augmented Reality
c. Virtual Reality 
d. None of the above

Show Answer ⟶
c. Virtual Reality

Emerging Trends Class 11 MCQ

10. Virtual Reality have been used in the field of __________.
a. Military training
b. Psychology
c. Medical procedures
d. All of the above 

Show Answer ⟶
d. All of the above

11. The superimposition of computer generated perceptual information over the existing physical surroundings is called as ________.
a. Immersive experiences
b. Augmented Reality 
c. Virtual Reality
d. None of the above

Show Answer ⟶
b. Augmented Reality

12. A ___________ is basically a machine capable of carrying out one or more tasks automatically with accuracy and precision.
a. Immersive experiences
b. Augmented Reality
c. Virtual Reality
d. Robot 

Show Answer ⟶
d. Robot

13. What are the different types of robots.
a. Wheeled robots
b. Manipulators
c. Humanoids
d. All of the above 

Show Answer ⟶
d. All of the above

14. NASA’s Mars exploration _________ mission is a a robotic space mission to study about the planet mars.
a. Rover 
b. Sophia
c. Drone
d. None of the above

Show Answer ⟶
a. Rover

Emerging Trends Class 11 MCQ

15. ____________ is a humanoid that uses artificial intelligence, visual data processing, facial recognition and also imitates human gestures and facial expressions.
a. Rover
b. Sophia 
c. Drone
d. None of the above

Show Answer ⟶
b. Sophia

16. A __________ is an unmanned aircraft which can be remotely controlled or can fly autonomously through software-controlled flight plans in their embedded systems, working in conjunction with onboard sensors and GPS.
a. Rover
b. Sophia
c. Drone 
d. None of the above

Show Answer ⟶
c. Drone

17. Network of interconnected items with integrated sensors that can gather and transmit data in real time is known as the _______.
a. Internet of Things 
b. Big Data
c. Model
d. None of the above

Show Answer ⟶
a. Internet of Things

18. Today, there are over a billion Internet users, and a majority of the world’s web data is coming from different device, this is the best example of __________.
a. Top Data
b. Big Data 
c. Model
d. None of the above

Show Answer ⟶
b. Big Data

19. What are the different challenges in the Big data.
a. Integration
b. Storage
c. Analysis
d. All of the above 

Show Answer ⟶
d. All of the above

Emerging Trends Class 11 MCQ

20. What is the characteristics of big data.
a. Volume & Velocity
b. Variety & Veracity
c. Value
d. All of the above 

Show Answer ⟶
d. All of the above

21. Big data has an exponentially higher rate of generation than traditional data sets.
a. Volume
b. Velocity 
c. Variety
d. Veracity

Show Answer ⟶
b. Velocity

22. Dataset has varied data, such as structured, semi-structured and unstructured data.
a. Volume
b. Velocity
c. Variety 
d. Veracity

Show Answer ⟶
c. Variety

23. ________ refers to the trustworthiness of the data because processing such incorrect data can give wrong results or mislead.
the interpretations.
a. Volume
b. Velocity
c. Variety
d. Veracity 

Show Answer ⟶
d. Veracity

24. __________ is the process of examining data sets in order to draw conclusions about the information they contain, with the aid of specialized systems and software.
a. Data Analytics 
b. Data Collection
c. Data Storage
d. None of the above

Show Answer ⟶
a. Data Analytics

Emerging Trends Class 11 MCQ

25. The _________ is a network of devices that have an embedded hardware and software to communicate (connect and exchange data) with other devices on the same network.
a. Internet of Things 
b. Big Data
c. Model
d. None of the above

Show Answer ⟶
a. Internet of Things

26. ____________ allows use of web services to connect anything in the physical world, besides human identities on web. It will pave way for creating smart homes, smart offices, smart cities and so on.
a. Internet of Things
b. Web of Things 
c. Model
d. None of the above

Show Answer ⟶
b. Web of Things

27. The ___________ sensors, tracks rotation or twist of your hand and add to the information supplied by the accelerometer.
a. Accelerometer
b. Gyroscope 
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. Gyroscope

28. The _________ sensor in the mobile phones detects the orientation of the phone.
a. Accelerometer 
b. Gyroscope
c. Both a) and b)
d. None of the above

Show Answer ⟶
a. Accelerometer

29. ___________ makes use of computer and communication technology along with IoT to manage and distribute resources efficiently.
a. Smart Cities 
b. Smart Ways
c. Smart planner
d. None of the above

Show Answer ⟶
a. Smart Cities

Emerging Trends Class 11 MCQ

30. _________ computing is an emerging trend in the field of information technology, where computer-based services are delivered over the Internet or the cloud, and it is accessible to the user from anywhere using any device.
a. Shared Computing
b. Cloud Computing 
c. VPN Computing
d. None of the above

Show Answer ⟶
b. Cloud Computing

31. __________ from the cloud, a user can use the hardware infrastructure located at a remote location to configure, deploy and execute any software application on that cloud infrastructure.
a. Infrastructure as a Service (IaaS) 
b. Platform as a Service (PaaS)
c. Software as a Service (SaaS)
d. None of the above

Show Answer ⟶
a. Infrastructure as a Service (IaaS)

32. _________ helps the user to install and execute an application without worrying about the underlying infrastructure and their setup.
a. Infrastructure as a Service (IaaS)
b. Platform as a Service (PaaS) 
c. Software as a Service (SaaS)
d. None of the above

Show Answer ⟶
b. Platform as a Service (PaaS)

33. _________ provides on-demand access to application software, usually requiring a licensing or subscription by the user. While using Google Doc, Microsoft Office 365, Drop Box, etc.
a. Infrastructure as a Service (IaaS)
b. Platform as a Service (PaaS)
c. Software as a Service (SaaS) 
d. None of the above

Show Answer ⟶
c. Software as a Service (SaaS)

34. A ___________ is a computer network of geographically dispersed and heterogeneous computational resources whose primary focus is to provide services, a grid is more application specific and creates a sense of a virtual supercomputer with an enormous processing power and storage.
a. Grid Computing 
b. Cloud Computing
c. Shared Computing
d. None of the above

Show Answer ⟶
a. Grid Computing

Emerging Trends Class 11 MCQ

35. __________, used to manage large and distributed data having required multi-user access.
a. Data Grid 
b. CPU or Processor Grid
c. Both a) and b)
d. None of the above

Show Answer ⟶
a. Data Grid

36. __________, where processing is moved from one PC to another as needed or a large task is divided into subtasks and divided to various nodes for parallel processing.
a. Data Grid
b. CPU or Processor Grid 
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. CPU or Processor Grid

37. The _________ technology works on the concept of decentralized and shared database where each computer has a copy of the database.
a. Blockchains 
b. Block grid
c. block cloud
d. None of the above

Show Answer ⟶
a. Blockchains

38. The most popular application of blockchains technology is in __________.
a. Open Office
b. Digital currency 
c. GIMP
d. None of the above

Show Answer ⟶
b. Digital currency

Encoding Schemes and Number System Class 11 MCQ

Teachers and Examiners (CBSESkillEduction) collaborated to create the Encoding Schemes and Number System Class 11 MCQ. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Encoding Schemes and Number System Class 11 MCQ

1. When a key on the keyboard is pressed, it is internally mapped to a unique code, which is further converted to __________.
a. Binary
b. Decimal
c. Object
d. None of the above

Show Answer ⟶
a. Binary

2. The mechanism of converting data into an equivalent cipher using specific code is called __________.
a. Software
b. Encoding
c. Hardware
d. None of the above

Show Answer ⟶
b. Encoding

3. ASCII Stands for ______________.
a. American Standard Code for Interchange Information
b. American Standard Code for Information Interchange
c. American Simple Code for Interchange Information
d. None of the above

Show Answer ⟶
b. American Standard Code for Information Interchange

4. ASCII used __________ bits to represent characters.
a. 8 Bits
b. 7 bits
c. 6 bits
d. 5 bits

Show Answer ⟶
b. 7 bits

Encoding Schemes and Number System Class 11 MCQ

5. Encoding scheme _________ was developed for standardizing the character representation.
a. Software
b. Hardware
c. ASCII
d. None of the above

Show Answer ⟶
c. ASCII

6. ISCII Stands for ___________.
a. Indian Script Code for Information Interchange
b. Indonesia Standard Code for Information Interchange
c. Indian Simple Code for Interchange Information
d. None of the above

Show Answer ⟶
a. Indian Script Code for Information Interchange

7. ISCII is an ______ bit code representation for Indian languages.
a. 8 – bit
b. 7 – bit
c. 6 – bit
d. 5 – bit

Show Answer ⟶
a. 8 – bit

8. __________ provides a unique number for every character, irrespective of device (server, desktop, mobile), operating system (Linux, Windows, iOS) or software application (different browsers, text editors, etc.).
a. ISCII
b. ASCII
c. Unicode
d. None of the above

Show Answer ⟶
c. Unicode

9. Commonly used UNICODE encodings are ___________.
a. UTF-8
b. UTF-16
c. UTF-32
d. All of the above

Show Answer ⟶
d. All of the above

Encoding Schemes and Number System Class 11 MCQ

10. The code for character “A” belongs to _________ASCII code.
a. 65
b. 66
c. 67
d. 68

Show Answer ⟶
a. 65

11. The code for character “a” belongs to _________ASCII code.
a. 96
b. 97
c. 98
d. 99

Show Answer ⟶
b. 97

12. Every number system has a set of unique characters or literals. The count of these literals is called the __________.
a. Radix
b. Base of the number system
c. Both a) and b)
d. None of the above

Show Answer ⟶
c. Both a) and b)

13. What is the base of Binary number _______.
a. Base 2
b. Base 16
c. Base 10
d. Base 8

Show Answer ⟶
a. Base 2

14. Hexadecimal number is called ________ system.
a. Base 2
b. Base 16
c. Base 10
d. Base 8

Show Answer ⟶
b. Base 16

Encoding Schemes and Number System Class 11 MCQ

15. Decimal number system is called __________ system.
a. Base 2
b. Base 16
c. Base 10
d. Base 8

Show Answer ⟶
c. Base 10

16. Octal number system is called ________ system.
a. Base 2
b. Base 16
c. Base 10
d. Base 8

Show Answer ⟶
d. Base 8

17. Hexadecimal numbers are a mixture of _____________
a. Octal and decimal numbers
b. Binary and decimal numbers
c. Letters and decimal digits
d. Binary and octal numbers

Show Answer ⟶
c. Letters and decimal digits

18. ASCII code is an
a. Alphabet code
b. Numeric code
c. Alpha numeric code
d. Cyclic code

Show Answer ⟶
c. Alpha numeric code

19. ASCII Code is a 7 bit code for ________
a. Letters
b. Other symbols
c. Numbers
d. All of the above

Show Answer ⟶
d. All of the above

Encoding Schemes and Number System Class 11 MCQ

20. The two’s complement in binary system is useful for expressing
a. Positive numbers
b. Both positive and negative numbers
c. Negative numbers
d. None of the above

Show Answer ⟶
c. Negative numbers

21. The binary number 10011101 is equal to the decimal number
a. 9E
b. 9D
c. 9F
d. FU

Show Answer ⟶
b. 9D

22. Name the number system which uses alphabets as well as numerals
a. Binary
b. Decimal Number System
c. Octal Number System
d. Hexadecimal Number System

Show Answer ⟶
d. Hexadecimal Number System

23. Which out of the following Binary numbers is equivalent to decimal number 24
a. 110111
b. 111111
c. 11000
d. 11001

Show Answer ⟶
c. 11000

24. One Nibble contain the number of bits equal to
a. 2
b. 4
c. 8
d. 16

Show Answer ⟶
b. 4

Encoding Schemes and Number System Class 11 MCQ

25. The largest two-digit hexadecimal number is _________.
a. (FD)16
b. (FE)16
c. (FF)16
d. (EF)16

Show Answer ⟶
c. (FF)16

26. The ICs (Integrated Circuits) in a computer are made up of a large number of _________.
a. Transistors
b. Capacitors
c. Resistance
d. None of the above

Show Answer ⟶
a. Transistors

27. Electronic signals are also represent as ________.
a. ON and OFF
b. High and Low
c. Both a) and b)
d. None of the above

Show Answer ⟶
c. Both a) and b)

28. The ON/ high and OFF/low state of a transistor is represented using the two digits _________.
a. 1 and 0
b. 2 and 9
c. 3 and 8
d. None of the above

Show Answer ⟶
a. 1 and 0

29. A binary number can be mapped to an equivalent _________ that can be easily understood by the human.
a. Decimal Number
b. Unicode
c. ASCII code
d. None of the above

Show Answer ⟶
a. Decimal Number

Encoding Schemes and Number System Class 11 MCQ

30. Octal number system was devised for ___________ of the binary numbers.
a. Brief representation
b. Compact representation
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. Compact representation

31. Octal number system is called base-8 system as it has total eight digits _______.
a. 1 to 8
b. 0 to 7
c. 2 to 9
d. None of the above

Show Answer ⟶
b. 0 to 7

32. Hexadecimal number consists of 16 unique symbols _________.
a. 0 – 9
b. A – F
c. Both a) and b)
d. None of the above

Show Answer ⟶
c. Both a) and b)

33. The decimal numbers 10 through 15 are represented by the letters _________ in Hexadecimal Number.
a. A to F
b. F to K
c. K to P
d. None of the above

Show Answer ⟶
a. A to F

34. Hexadecimal numbers are also used for describing the _________ on the webpage.
a. Tag
b. Color
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. Color

Encoding Schemes and Number System Class 11 MCQ

35. To convert decimal to binary, which decimal number is repeatedly used.
a. 2
b. 3
c. 4
d. 5

Show Answer ⟶
a. 2

36. To convert decimal to octal, which decimal number is repeatedly used.
a. 2
b. 8
c. 16
d. 32

Show Answer ⟶
b. 8

37. To convert decimal to Hexadecimal, which decimal number is repeatedly used.
a. 2
b. 8
c. 16
d. 32

Show Answer ⟶
c. 16

38. Textual data is encoded using __________.
a. ASCII
b. ISCII
c. Unicode
d. All of the above

Show Answer ⟶
d. All of the above

39. _________ scheme is a character encoding standard which can encode all the characters of almost all languages of the world.
a. ASCII
b. ISCII
c. Unicode
d. All of the above

Show Answer ⟶
c. Unicode
Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

Tuples in Python Class 11 Notes

tuples in python class 11 notes

Teachers and Examiners (CBSESkillEduction) collaborated to create the Tuples in Python Class 11 Notes. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Tuples in Python Class 11 Notes

Introduction to Tuples

An ordered collection of components of various data kinds, such as integer, float, string, list, is known as a tuple. A tuple’s components are denoted by parenthesis (round brackets) and commas. A tuple’s elements can be retrieved using index values beginning at 0 just like list and string members can.

Example 1 –
>>> tuple1 = (1,2,3,4,5)
>>> tuple1
(1, 2, 3, 4, 5)

Example 2 –
>>> tuple2 =(‘Economics’,87,’Accountancy’,89.6)
>>> tuple2
(‘Economics’, 87, ‘Accountancy’, 89.6)

Example 3 –
>>> tuple3 = (10,20,30,[40,50])
>>> tuple3
(10, 20, 30, [40, 50])

Example 4 –
>>> tuple4 = (1,2,3,4,5,(10,20))
>>> tuple4
(1, 2, 3, 4, 5, (10, 20))

Tuples in Python Class 11 Notes

Accessing Elements in a Tuple

Elements of a tuple can be accessed in the same way as a list or string using indexing and slicing.

Example 1 –
>>> tuple1 = (2,4,6,8,10,12)
>>> tuple1[0]
2

Example 2 –
>>> tuple1 = (2,4,6,8,10,12)
>>> tuple1[3]
8

Example 3 –
>>> tuple1 = (2,4,6,8,10,12)
>>> tuple1[15]
IndexError: tuple index out of range

Example 4 –
>>> tuple1 = (2,4,6,8,10,12)
>>> tuple1[1+4]
12

Example 5 –
>>> tuple1 = (2,4,6,8,10,12)
>>> tuple1[-1]
12

Tuples in Python Class 11 Notes

Tuple is Immutable

Tuple is an immutable data type. It means that the elements of a tuple cannot be changed after it has been created. An attempt to do this would lead to an error.

Example –
>>> tuple1 = (1,2,3,4,5)
>>> tuple1[4] = 10
TypeError: ‘tuple’ object does not support item assignment

Tuple Operations

Concatenation

Python allows us to join tuples using concatenation operator depicted by symbol +.

Example –
>>> tuple1 = (1,3,5,7,9)
>>> tuple2 = (2,4,6,8,10)
>>> tuple1 + tuple2
(1, 3, 5, 7, 9, 2, 4, 6, 8, 10)

Repetition

Repetition operation is depicted by the symbol *. It is used to repeat elements of a tuple.

Example –
>>> tuple1 = (‘Hello’,’World’)
>>> tuple1 * 3
(‘Hello’, ‘World’, ‘Hello’, ‘World’, ‘Hello’, ‘World’)

Tuples in Python Class 11 Notes

Membership

The in operator checks if the element is present in the tuple and returns True, else it returns False.

Example 1 –
>>> tuple1 = (‘Red’,’Green’,’Blue’)
>>> ‘Green’ in tuple1
True

Example 2 –
>>> tuple1 = (‘Red’,’Green’,’Blue’)
>>> ‘Green’ not in tuple1
False

Slicing

Like string and list, slicing can be applied to tuples also.

Example –
>>> tuple1 = (10,20,30,40,50,60,70,80)
>>> tuple1[2:7]
(30, 40, 50, 60, 70)

Tuples in Python Class 11 Notes

Tuple Methods and Built-in Functions

Python provides many functions to work on tuples.

len()

Returns the length or the number of elements of the tuple passed as the argument.

Example –
>>> tuple1 = (10,20,30,40,50)
>>> len(tuple1)
5

tuple()

Creates an empty tuple if no argument is passed, if a sequence is passed as argument.

Example 1 –
>>> tuple1 = tuple()
>>> tuple1
( )

Example 2 –
>>> tuple1 = tuple(‘aeiou’)
>>> tuple1
(‘a’, ‘e’, ‘i’, ‘o’, ‘u’)

count()

Returns the number of times the given element appears in the tuple

Example –
>>> tuple1 = (10,20,30,10,40,10,50)
>>> tuple1.count(10)
3
>>> tuple1.count(90)
0

index()

Returns the index of the first occurrence of the element in the given tuple.

Example –
>>> tuple1 = (10,20,30,40,50)
>>> tuple1.index(30)
2
>>> tuple1.index(90)
ValueError: tuple.index(x): x not in tuple

sorted()

Takes elements in the tuple and returns a new sorted list. It should be noted that, sorted() does not make any change to the original tuple.

Example –
>>> tuple1 = (“Rama”,”Heena”,”Raj”, “Mohsin”,”Aditya”)
>>> sorted(tuple1)
[‘Aditya’, ‘Heena’, ‘Mohsin’, ‘Raj’, ‘Rama’]

min()

Returns minimum or smallest element of the tuple.

Example –
>>> tuple1 = (19,12,56,18,9,87,34)
>>> min(tuple1)
9

max()

Returns maximum or largest element of the tuple

Example –
>>> tuple1 = (19,12,56,18,9,87,34)
>>> max(tuple1)
87

sum()

Returns sum of the elements of the tuple.

Example –
>>> tuple1 = (19,12,56,18,9,87,34)
>>> sum(tuple1)
235

Tuple Assignment

Python has a useful feature called assignment of tuples. It enables the assignment of appropriate values to a tuple of variables on the left side of the assignment operator from a tuple on the right side. The left-hand side variables should have the same amount of components as the tuple.

Example 1 –
>>> (num1,num2) = (10,20)
>>> print(num1)
10
>>> print(num2)
20

Example 2 –
>>> record = ( “Pooja”,40,”CS”)
>>> (name,rollNo,subject) = record
>>> name
‘Pooja’
>>> rollNo
40
>>> subject
‘CS’

Nested Tuples

A nested tuple is one that contains another tuple inside of it. Students’ names, roll numbers, and grades (in percentage) are saved in a tuple. We can create a nested tuple to contain the information of many of these students.

Example –
st=((101,”Aman”,98),(102,”Geet”,95),(103,”Sahil”,87),(104,”Pawan”,79))
print(“S_No”,” Roll_No”,” Name”,” Marks”)
for i in range(0,len(st)):
     print((i+1),’\t’,st[i][0],’\t’,st[i][1],’\t’,st[i][2])

Output:
S_No Roll_No Name Marks
1 101 Aman 98
2 102 Geet 95
3 103 Sahil 87
4 104 Pawan 79

Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

Dictionaries in Python Class 11 Notes

dictionaries in python class 11 notes

Teachers and Examiners (CBSESkillEduction) collaborated to create the Dictionaries in Python Class 11 Notes. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Dictionaries in Python Class 11 Notes

Introduction to Dictionaries

Maps include the data type dictionary. A collection of keys and a set of values are mapped in this situation. Items are keys and values pairs. Consecutive entries are separated by commas, and a colon (:) separates a key from its value. Dictionary entries are unordered, thus we might not receive the data in the same order that we entered it when we first placed it in the dictionary.

Creating a Dictionary

The words entered are contained in curly brackets and are separated by commas to form a dictionary. Each item is a pair of key values that are separated by colons (:). The dictionary’s keys must be distinct and of any immutable data type, such as an integer, text, or tuple. The values may be of any data type and may be repeated.

Example –
>>> dict3 = {‘Mohan’:95,’Ram’:89,’Suhel’:92,’Sangeeta’:85}
>>> dict3
{‘Mohan’: 95, ‘Ram’: 89, ‘Suhel’: 92,’Sangeeta’: 85}

Accessing Items in a Dictionary

We have already seen how an approach known as indexing is used to retrieve the elements of a sequence (string, list, and tuple). The keys in a dictionary are used to access the objects rather than their indices or relative places. Each key corresponds to a value and acts as an index.

Example –
>>> dict3 = {‘Mohan’:95,’Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> dict3[‘Ram’]
89
>>> dict3[‘Sangeeta’]
85

Dictionaries in Python Class 11 Notes

Dictionaries are Mutable

Dictionaries are mutable which implies that the contents of the dictionary can be changed after it has been created.

Adding a new item

We can add a new item to the dictionary as shown in the following example –

Example –
>>> dict1 = {‘Mohan’:95,’Ram’:89,’Suhel’:92,’Sangeeta’:85}
>>> dict1[‘Meena’] = 78
>>> dict1
{‘Mohan’: 95, ‘Ram’: 89, ‘Suhel’: 92,’Sangeeta’: 85, ‘Meena’: 78}

Modifying an Existing Item

The existing dictionary can be modified by just overwriting the key-value pair. Example to modify a given item in the dictionary –

Example –
>>> dict1 = {‘Mohan’:95,’Ram’:89,’Suhel’:92,’Sangeeta’:85}
>>> dict1[‘Suhel’] = 93.5
>>> dict1
{‘Mohan’: 95, ‘Ram’: 89, ‘Suhel’: 93.5,’Sangeeta’: 85}

Dictionary Operations
Membership

The membership operator in checks if the key is present in the dictionary and returns True, else it returns False.

Example –
>>> dict1 = {‘Mohan’:95,’Ram’:89,’Suhel’:92,’Sangeeta’:85}
>>> ‘Suhel’ in dict1
True

The not in operator returns True if the key is not present in the dictionary, else it returns False.

Example –
>>> dict1 = {‘Mohan’:95,’Ram’:89,’Suhel’:92,’Sangeeta’:85}
>>> ‘Suhel’ not in dict1
False

Dictionaries in Python Class 11 Notes

Traversing a Dictionary

We can access each item of the dictionary or traverse a dictionary using for loop.

Example –
>>> dict1 ={‘Mohan’:95,’Ram’:89,’Suhel’:92,’Sangeeta’:85}
>>> for key in dict1:
              print(key,’:’,dict1[key])

Output –
Mohan: 95
Ram: 89
Suhel: 92
Sangeeta: 85

Dictionary methods and Built-in functions

Python provides many functions to work on dictionaries.

len()

Returns the length or number of key: value pairs of the dictionary passed as the argument.

Example –
>>> dict1 = {‘Mohan’:95,’Ram’:89,
‘Suhel’:92, ‘Sangeeta’:85}
>>> len(dict1)
4

dict()

Creates a dictionary from a sequence of key-value pairs.

Example –
pair1 = [(‘Mohan’,95),(‘Ram’,89),(‘Suhel’,92),(‘Sangeeta’,85)]
>>> pair1
[(‘Mohan’, 95), (‘Ram’, 89), (‘Suhel’,92), (‘Sangeeta’, 85)]
>>> dict1 = dict(pair1)
>>> dict1
{‘Mohan’: 95, ‘Ram’: 89, ‘Suhel’: 92,’Sangeeta’: 85}

keys()

Returns a list of keys in the dictionary.

Example –
>>> dict1 = {‘Mohan’:95, ‘Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> dict1.keys()
dict_keys([‘Mohan’, ‘Ram’, ‘Suhel’,’Sangeeta’])

values()

Returns a list of values in the dictionary.

Example –
>>> dict1 = {‘Mohan’:95, ‘Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> dict1.values()
dict_values([95, 89, 92, 85])

Dictionaries in Python Class 11 Notes

items()

Returns a list of tuples(key – value) pair

Example –
>>> dict1 = {‘Mohan’:95, ‘Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> dict1.items()
dict_items([( ‘Mohan’, 95), (‘Ram’,89), (‘Suhel’, 92), (‘Sangeeta’, 85)])

get()

Returns the value corresponding to the key passed as the argument.

Example –
>>> dict1 = {‘Mohan’:95, ‘Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> dict1.get(‘Sangeeta’)
85

update()

appends the key-value pair of the dictionary passed as the argument to the key-value pair of the given dictionary.

Example –
>>> dict1 = {‘Mohan’:95, ‘Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> dict2 = {‘Sohan’:79,’Geeta’:89}
>>> dict1.update(dict2)
>>> dict1
{‘Mohan’: 95, ‘Ram’: 89, ‘Suhel’: 92,’Sangeeta’: 85, ‘Sohan’: 79, ‘Geeta’:89}
>>> dict2
{‘Sohan’: 79, ‘Geeta’: 89}

Dictionaries in Python Class 11 Notes

del()

Deletes the item with the given key To delete the dictionary from the memory we write: del Dict_name

Example –
>>> dict1 = {‘Mohan’:95,’Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> del dict1[‘Ram’]
>>> dict1
{‘Mohan’:95,’Suhel’:92, ‘Sangeeta’: 85}
>>> del dict1 [‘Mohan’]
>>> dict1
{‘Suhel’: 92, ‘Sangeeta’: 85}

clear()

Deletes or clear all the items of the dictionary

Example –
>>> dict1 = {‘Mohan’:95,’Ram’:89,’Suhel’:92, ‘Sangeeta’:85}
>>> dict1.clear()
>>> dict1
{ }

Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

Societal Impact Class 11 Notes

societal impact class 11 notes

Teachers and Examiners (CBSESkillEduction) collaborated to create the Societal Impact Class 11 Notes. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Societal Impact Class 11 Notes

Digital Footprints

The websites we visit, emails we send, any information we post online, etc., as well as the IP address, location, and other device-specific information of the computer this is known as digital footprint. or you can say data left behind by users after they utilise the internet is known as a digital footprint.

Example of digital footprint
a. Search history
b. Photos and Videos
c. Like/ dislike in social media
d. Browser history

We leave two different types of digital footprints.

  1. Active digital footprint – data that we consciously submit online is included in our active digital footprints.
    This would include any emails we send, comments or postings we make on various websites or apps, etc.
  2. Passive digital footprints – are the traces of data we unwittingly leave online. Included in this are the data produced when we access a website, utilise a mobile app, explore the internet, etc.

Societal Impact Class 11 Notes

Digital Society and Netizen

A digital citizen, often known as a netizen, is someone who uses digital technology and the Internet. A good netizen uses digital technology in a safe, moral, and legal manner. Internet etiquette, communication etiquette, and social media etiquette must all be followed by a responsible netizen.

Net Etiquettes

When we engage with others, we adhere to specific social norms. Similar to this, we must act appropriately and politely when using the internet. While online, one should behave ethically, respectfully, and responsibly.

Be Ethical
  • No copyright violation – We should not use copyrighted materials without the permission of the creator or owner.
  • Share the expertise – It is beneficial to share expertise and information online so that others can use it. However, we must be confident that we are sufficiently knowledgeable about a subject before sharing any information.
Be Respectful
  • Respect privacy – As good digital citizens we have the right to privacy and the freedom of personal expression. At the same time, we have to understand that other digital citizens also have the same rights and freedoms.
  • Respect diversity – in a group or public forum, we should respect the diversity of the people in terms of knowledge, experience, culture and other aspects.
Be Responsible
  • Avoid cyber bullying – We have to avoid insulting, degrading or intimidating online behaviour like repeated posting of rumours, giving threats online, posting the victim’s personal information or sexual harassment. We need to realise that bullying online can have very serious implications on the other person (victim).
  • Don’t feed the troll – An Internet troll is someone who intentionally sows conflict online by provoking arguments, upsetting people, or by publishing controversial or irrelevant statements in online communities for fun.

Societal Impact Class 11 Notes

Communication Etiquettes

Email, texting, instant messaging, cell phone conversations, audio and video conferencing, forum posting, social networking site posting, etc. are all examples of digital communication. All of them are great opportunities to interact with others and share information, ideas, and knowledge.

Be Precise
  • Respect time – we should not waste precious time in responding to unnecessary emails or comments unless they have some relevance for us.
  • Respect data limits – For concerns related to data and bandwidth, very large attachments may be avoided. Rather send compressed files or link.
Be Polite
  • we should be polite and non-aggressive in our communication. We should avoid being abusive even if we don’t agree with others’ point of view.
Be Credible
  • We should be cautious while making a comment, replying or writing an email or forum post as such acts decide our credibility over a period of time.

Societal Impact Class 11 Notes

Social Media Etiquettes

We are familiar with several social networking platforms and may even have an account there. These websites enable users to submit or upload photographs of their ideas and experiences. It has started to influence how politics, business, entertainment, education, and other things turn out. There are certain social media etiquettes we must adhere to as well.

Be Secure
  • Choose password wisely – Users need to be aware of how to protect themselves and their accounts. Having a strong password that is updated periodically is the way to minimize the risk from hackers.
  • Know who you befriend – We must take precautions while making friends with strangers because their motives may be dangerous and harmful.
  • Beware of fake information – In social networks, fake posts, messages, and news are common. We should be aware of them as users.
Be Reliable
  • Think before uploading – On social networks, almost anything can be uploaded. But keep in mind that once posted, the file remains on the remote server even if we delete it. Therefore, we must tread cautiously while transmitting or uploading private or sensitive files that could compromise our privacy.

Societal Impact Class 11 Notes

Data Protection

Every nation in the globe has its unique data protection legislation (laws). These policies, which are formal legal papers, give the user instructions on how to handle, store, and transmit sensitive data. The goal of putting these policies into place is to guarantee that sensitive data is properly protected from change or disclosure.

Intellectual Property Right (IPR)

It is the inventor’s intellectual property if they come up with a novel idea. Intellectual property includes innovations, literary and artistic works, visual arts, names, and logos. The originator or intellectual property owner is the rightful proprietor of such concepts.

Copyright

Copyright gives creators legal protection for their original works, including writing, photography, audio and video recordings, computer software, sculptures, architectural creations, and other types of creative output like literary and artistic works. Copyrights are automatically granted to creators and authors.

Patent

Inventions are granted a patent. In opposed to copyright, the creator must submit an application (file) to patent the innovation. After receiving a patent, the owner gains the only authority to prohibit anyone from making, using, or selling the invention.

Trademark

Any visual symbol, word, name, design, slogan, label, etc. that sets the brand or business apart from other brands or businesses is considered a trademark.

Societal Impact Class 11 Notes

Violation of IPR

The following are some ways that intellectual property rights may be violated –

Plagiarism

Text, images, and videos may all be easily copied or shared. Plagiarism is the process of representing the thoughts or works of another person as one’s own. Plagiarism is defined as the act of taking someone else’s work and using it without crediting the author name or source.

Copyright Infringement

When we utilise someone else’s creative work without asking permission or, if the work is being sold, without paying for it, we are infringing their copyright.

Trademark Infringement

Unauthorized use of another’s trademark on goods and services is known as trademark infringement. Anyone who violates a trademark registered to them may face legal action from the trademark owner.

Societal Impact Class 11 Notes

Public Access and Open Source Software

Two well-known types of public licences are the GNU General Public License (GPL) and Creative Commons (CC).

  • Creative Common License – All types of creative works, including websites, music, movies, books, etc., use Creative Commons. CC makes it possible to distribute a copyrighted work freely.
  • General Public License – Another free software licence, the GNU GPL, allows users to run, study, share, and modify the software while also receiving frequent updates.

Societal Impact Class 11 Notes

Cyber Crime

To disrupt or harm data or services, a cybercriminal targets a computer or a network that connects it to other computers. Additionally, a cybercriminal could spread viruses and other malware in order to obtain private and confidential data for extortion and blackmail. Cybercrimes are committed with the goal to directly or indirectly cause physical harm, financial loss, or mental harassment against an individual, a group, an organisation, or even a country.

Hacking

Unauthorized access to a computer, computer network, or other digital system is known as hacking. Hackers frequently possess technical knowledge of both software and hardware. They search for bugs that they can use to access the system.

Phishing and Fraud Emails

Phishing is an illegal practise in which users are provided with false websites or emails that appear genuine or original in order to illegally obtain sensitive and personal information, including usernames, passwords, banking information, and credit card numbers.

Identity Theft – Identity thieves are increasingly leveraging personal data obtained illegally from computers or computer networks to conduct fraud.

Ransomware

The attacker gains access to the computer in this case and prevents the user from using it, typically by encrypting the data. When a ransom is not paid, the attacker may threaten to disclose the victim’s private and sensitive information or photos or use blackmail to force the victim to pay for access to the data.

Combatting and Preventing Cyber Crime

With the dual strategy of being cautious and seeking legal assistance, the difficulties of cybercrime can be reduced.
The following items can be thought of as safety precautions to lower the danger of cybercrime:

  • Take regular backup of important data
  • Use an antivirus software and keep it updated always
  • Avoid installing pirated software. Always download software from known and secure (HTTPS) sites
  • Always update the system software which include the Internet browser and other application software
  • Do not visit or download anything from untrusted websites
  • In most cases, the browser warns users about dubious websites whose security certificate could not be confirmed; stay away from such sites.
  • For web logins, use strong passwords, and change them frequently. Use a different password for each website. Use a variety of alphanumeric character combinations, including special characters. Don’t include common names or words in your password
  • Don’t let your browser remember your password or auto-fill information when using someone else’s computer, and attempt to browse in a private browser window.

Societal Impact Class 11 Notes

Indian Information Technology Act (IT Act)

The Information Technology Act, 2000 (commonly known as the IT Act) of the Government of India, as revised in 2008, offers instructions to the user on the handling, storing, and transfer of sensitive data.

There are cyber cells in police stations in various Indian states where one can report any cybercrime. By recognising digital signatures and electronic records, the legislation creates a legal framework for electronic government. The statute describes cybercrimes and their associated consequences.

Impact on Health

We are spending more time in front of screens, whether on our phones, laptops, desktop computers, televisions, gaming consoles, or music or sound equipment, as digital technologies have permeated several industries. However, conversing while hunched over might be detrimental to our health on both a physical and mental level. 

The science of ergonomics is the design or arrangement of workplaces, including the systems, furniture, and equipment, to make them safe and comfortable for the user. We can lessen the burden on our bodies thanks to ergonomics, including weariness and ailments brought on by continuous use.

Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

List Manipulation in Python Class 11 Notes

list manipulation in python class 11 notes

Teachers and Examiners (CBSESkillEduction) collaborated to create the List Manipulation in Python Class 11 Notes. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

List Manipulation in Python Class 11 Notes

Introduction to List

In Python, Multiple values (example, Number, Character, Date etc.) can be stored in a single variable by using lists., a list is an ordered sequence of elements that can be changed or modified. A list’s items are any elements or values that are contained within it. Lists are defined by having values inside square brackets [] just as strings are defined by characters inside quotations.

Example 1 – 
>>> list1 = [2,4,6,8,10,12]
>>> print(list1)
[2, 4, 6, 8, 10, 12]
Example 2 – 
>>> list2 = [‘a’,’e’,’i’,’o’,’u’]
>>> print(list2)
[‘a’, ‘e’, ‘i’, ‘o’, ‘u’]
Example 3 – 
>>> list3 = [100,23.5,’Hello’]
>>> print(list3)
[100, 23.5, ‘Hello’]

Accessing Elements in a List (Display Element from the List)

The elements of a list are accessed in the same way as characters are accessed in a string.

Example –

>>> list1 = [2,4,6,8,10,12]
>>> list1[0]
2
>>> list1[3]
8
>>> list1[15]
IndexError: list index out of range

Lists are Mutable

In Python, lists are mutable. It means that the contents of the list can be changed after it has been created.

Example – 

>>> list1 = [‘Red’,’Green’,’Blue’,’Orange’]
>>> list1[3] = ‘Black’
>>> list1
[‘Red’, ‘Green’, ‘Blue’, ‘Black’]

List Manipulation in Python Class 11 Notes

List Operations

The data type list allows manipulation of its contents through various operations as shown below.

Concatenation

Python allows us to join two or more lists using concatenation operator depicted by the symbol +.

Example 1 –
>>> list1 = [1,3,5,7,9]
>>> list2 = [2,4,6,8,10]
>>> list1 + list2
[1, 3, 5, 7, 9, 2, 4, 6, 8, 10]

Example 2 –
>>> list3 = [‘Red’,’Green’,’Blue’]
>>> list4 = [‘Cyan’, ‘Magenta’, ‘Yellow’ ,’Black’]
>>> list3 + list4
[‘Red’,’Green’,’Blue’,’Cyan’,’Magenta’, ‘Yellow’,’Black’]

Repetition

Python allows us to replicate a list using repetition operator depicted by symbol *.

>>> list1 = [‘Hello’]
>>> list1 * 4
[‘Hello’, ‘Hello’, ‘Hello’, ‘Hello’]

Membership

Like strings, the membership operators in checks if the element is present in the list and returns True, else returns False.

>>> list1 = [‘Red’,’Green’,’Blue’]
>>> ‘Green’ in list1
True
>>> ‘Cyan’ in list1
False

Slicing

Like strings, the slicing operation can also be applied to lists.

Example 1 –
>>> list1 =[‘Red’,’Green’,’Blue’,’Cyan’, ‘Magenta’,’Yellow’,’Black’]
>>> list1[2:6]
[‘Blue’, ‘Cyan’, ‘Magenta’, ‘Yellow’]

Example 2 –
>>> list1[2:20] #second index is out of range
[‘Blue’, ‘Cyan’, ‘Magenta’, ‘Yellow’, ‘Black’]

List Manipulation in Python Class 11 Notes

Traversing a List

We can access each element of the list or traverse a list using a for loop or a while loop.

List Traversal Using for Loop –

Example –
>>> list1 = [‘Red’,’Green’,’Blue’,’Yellow’, ‘Black’]
>>> for item in list1:
print(item)

Output:
Red
Green
Blue
Yellow
Black

List Traversal Using while Loop –

Example –
>>> list1 = [‘Red’,’Green’,’Blue’,’Yellow’, ‘Black’]
>>> i = 0
>>> while i < len(list1):
print(list1[i])
i += 1

Output:
Red
Green
Blue
Yellow
Black

List Manipulation in Python Class 11 Notes

List Methods and Built-in Functions

The data type list has several built-in methods that are useful in programming.

len()

Returns the length of the list passed as the argument

>>> list1 = [10,20,30,40,50]
>>> len(list1)
5

list()

Creates an empty list if no argument is passed Creates a list if a sequence is passed as an argument

Example –
>>> list1 = list()
>>> list1
[ ]
>>> str1 = ‘aeiou’
>>> list1 = list(str1)
>>> list1
[‘a’, ‘e’, ‘i’, ‘o’, ‘u’]

append()

Appends a single element passed as an argument at the end of the list. The single element can also be a list.

Example –
>>> list1 = [10,20,30,40]
>>> list1.append(50)
>>> list1
[10, 20, 30, 40, 50]
>>> list1 = [10,20,30,40]
>>> list1.append([50,60])
>>> list1
[10, 20, 30, 40, [50, 60]]

extend()

Appends each element of the list passed as argument to the end of the given list.

Example –
>>> list1 = [10,20,30]
>>> list2 = [40,50]
>>> list1.extend(list2)
>>> list1
[10, 20, 30, 40, 50]

insert()

Inserts an element at a particular index in the list

Example –
>>> list1 = [10,20,30,40,50]
>>> list1.insert(2,25)
>>> list1
[10, 20, 25, 30, 40, 50]
>>> list1.insert(0,5)
>>> list1
[5, 10, 20, 25, 30, 40, 50]

count()

Returns the number of times a given element appears in the list

Example –
>>> list1 = [10,20,30,10,40,10]
>>> list1.count(10)
3
>>> list1.count(90)
0

index()

Returns index of the first occurrence of the element in the list. If the element is not present, ValueError is generated.

Example –
>>> list1 = [10,20,30,20,40,10]
>>> list1.index(20)
1
>>> list1.index(90)
ValueError: 90 is not in list

remove()

Removes the given element from the list. If the element is present multiple times, only the first occurrence is
removed. If the element is not present, then ValueError is generated.

Example –
>>> list1 = [10,20,30,40,50,30]
>>> list1.remove(30)
>>> list1
[10, 20, 40, 50, 30]
>>> list1.remove(90)
ValueError:list.remove(x):x not in list

List Manipulation in Python Class 11 Notes

pop()

Returns the element whose index is passed as parameter to this function and also removes it from the list. If no parameter is given, then it returns and removes the last element of the list.

Example –
>>> list1 = [10,20,30,40,50,60]
>>> list1.pop(3)
40
>>> list1
[10, 20, 30, 50, 60]
>>> list1 = [10,20,30,40,50,60]
>>> list1.pop()
60
>>> list1
[10, 20, 30, 40, 50]

reverse()

Reverses the order of elements in the given list

Example –
>>> list1 = [34,66,12,89,28,99]
>>> list1.reverse()
>>> list1
[ 99, 28, 89, 12, 66, 34]
>>> list1 = [ ‘Tiger’ ,’Zebra’ , ‘Lion’ , ‘Cat’ ,’Elephant’ ,’Dog’]
>>> list1.reverse()
>>> list1
[‘Dog’, ‘Elephant’, ‘Cat’, ‘Lion’, ‘Zebra’, ‘Tiger’]

sort()

Sorts the elements of the given list in-place

Example –
>>>list1 = [‘Tiger’,’Zebra’,’Lion’, ‘Cat’, ‘Elephant’ ,’Dog’]
>>> list1.sort()
>>> list1
[‘Cat’, ‘Dog’, ‘Elephant’, ‘Lion’, ‘Tiger’, ‘Zebra’]
>>> list1 = [34,66,12,89,28,99]
>>> list1.sort(reverse = True)
>>> list1
[99,89,66,34,28,12]

sorted()

It takes a list as parameter and creates a new list consisting of the same elements arranged in sorted order.

Example –
>>> list1 = [23,45,11,67,85,56]
>>> list2 = sorted(list1)
>>> list1
[23, 45, 11, 67, 85, 56]
>>> list2
[11, 23, 45, 56, 67, 85]

min()

Returns minimum or smallest element of the list

Example –
>>> list1 = [34,12,63,39,92,44]
>>> min(list1)
12

List Manipulation in Python Class 11 Notes

max()

Returns maximum or largest element of the list

Example –
>>> list1 = [34,12,63,39,92,44]
>>> max(list1)
92

sum()

Returns sum of the elements of the list

Example –
>>> list1 = [34,12,63,39,92,44]
>>> sum(list1)
284

Nested Lists

When a list appears as an element of another list, it is called a nested list.

Example –
>>> list1 = [1,2,’a’,’c’,[6,7,8],4,9]
>>> list1[4]
[6, 7, 8]

Copying Lists

The simplest way to make a copy of the list is to assign it to another list.

Example –
>>> list1 = [1,2,3]
>>> list2 = list1
>>> list1
[1, 2, 3]
>>> list2
[1, 2, 3]

List as Argument to a Function

Whenever a list is passed as an argument to a function, we have to consider two scenarios:

(A) A modification to the list in the function will be mirrored back in the calling function, which allows for changes to the original list’s elements.

Q. Program to increment the elements of a list. The list is passed as an argument to a function.

#Program
#Function to increment the elements of the list passed as argument
def increment(list2):
for i in range(0,len(list2)):
list2[i] += 5
print(‘Reference of list Inside Function’,id(list2))
list1 = [10,20,30,40,50] 
print(“Reference of list in Main”,id(list1))
print(“The list before the function call”)
print(list1)
increment(list1) 
print(“The list after the function call”)
print(list1)

Output:
Reference of list in Main 70615968
The list before the function call
[10, 20, 30, 40, 50]
Reference of list Inside Function 70615968 
The list after the function call
[15, 25, 35, 45, 55]

(B) If the list is given a new value inside the function, a new list object is generated and it becomes the local copy of the function. Any updates made inside the local copy of the function are not updated in the calling function.

List Manipulation in Python Class 11 Notes

Q. Program to increment the elements of the list passed as parameter.

#Program 
#Function to increment the elements of the list passed as argument
def increment(list2):
print(“\nID of list inside function before assignment:”, id(list2))
list2 = [15,25,35,45,55] 
print(“ID of list changes inside function after assignment:”, id(list2))
print(“The list inside the function after assignment is:”)
print(list2)
list1 = [10,20,30,40,50] 
print(“ID of list before function call:”,id(list1))
print(“The list before function call:”)
print(list1)
increment(list1) #list1 passed as parameter to function
print(‘\nID of list after function call:’,id(list1))
print(“The list after the function call:”)
print(list1)

Output:
ID of list before function call: 65565640
The list before function call:
[10, 20, 30, 40, 50]
ID of list inside function before assignment:65565640
ID of list changes inside function after assignment:65565600
The list inside the function after assignment is:
[15, 25, 35, 45, 55]
ID of list after function call: 65565640
The list after the function call:
[10, 20, 30, 40, 50]

Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

Strings in Python Class 11 Notes

Teachers and Examiners (CBSESkillEduction) collaborated to create the Strings in Python Class 11 Notes. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Strings in Python Class 11 Notes

Strings

A string is a group of one or more UNICODE characters in sequence. A letter, number, space, or any other sign may be used as the character in this situation. One or more characters can be enclosed in a single, double, or triple quote to produce a string.

Example – 

>>> str1 = ‘Hello World!’
>>> str2 = “Hello World!”
>>> str3 = “””Hello World!”””
>>> str4 = ”’Hello World!”

Note – Python accepts single (‘), double (“), triple (”’) or triple(“””) quotes to denote string literals. Single quoted strings and double quoted strings are equal. Triple quotes are used for contain special characters like TAB, or NEWLINES.

Strings in Python Class 11 Notes

Accessing Characters in a String

A method known as indexing can be used to retrieve each individual character in a string. The character to be retrieved in the string is specified by the index, which is enclosed in square brackets ([ ]). The string has an index of 0 for the first character (counted from the left) and n-1 for the last character, where n is the string’s length. We receive an IndexError if we provide an index value outside of this range. A number must make up the index (positive, zero or negative).

string in python

String is Immutable

A string is an immutable data type. It means that the contents of the string cannot be changed after it has been created. An attempt to do this would lead to an error.

>>> str1 = “Hello World!”
#if we try to replace character ‘e’ with ‘a’
>>> str1[1] = ‘a’
TypeError: ‘str’ object does not support item assignment

Strings in Python Class 11 Notes

String Operations

A string is a group of letters and numbers. Concatenation, repetition, membership, and slicing are just a few of the operations Python supports on the string data type. The following subsections provide explanations of these procedures along with pertinent examples.

Concatenation

To concatenate means to join. Python allows us to join two strings using concatenation operator plus which is denoted by symbol +.

>>> str1 = ‘Hello’
>>> str2 = ‘World!’
>>> str1 + str2

Output:
Hello World!

Repetition

Python allows us to repeat the given string using repetition operator which is denoted by symbol *.

>>> str1 = ‘Hello’
>>> str1 * 2

Output:
>>> str1 * 5
‘HelloHelloHelloHelloHello’

Membership

Python has two membership operators ‘in’ and ‘not in’. The ‘in’ operator takes two strings and returns True if the first string appears as a substring in the second string, otherwise it returns False.

In

>>> str1 = ‘Hello World!’
>>> ‘W’ in str1
True
>>> ‘Wor’ in str1
True
>>> ‘My’ in str1
False

Not In

>>> str1 = ‘Hello World!’
>>> ‘My’ not in str1
True
>>> ‘Hello’ not in str1
False

Slicing

In Python, to access some part of a string or substring, we use a method called slicing. This can be done by specifying an index range. Given a string str1, the slice operation str1[n:m].

>>> str1 = ‘Hello World!’
>>> str1[1:5]
‘ello’
>>> str1[7:10]
‘orl’
>>> str1[3:20]
‘lo World!’
>>> str1[7:2]

Strings in Python Class 11 Notes

Traversing a String

We can access each character of a string or traverse a string using for loop and while loop.

String Traversal Using for Loop:

>>> str1 = ‘Hello World!’
>>> for ch in str1:
print(ch,end = ”)
Hello World!

In the above code, the loop starts from the first character of the string str1 and automatically ends when the last character is accessed.

String Traversal Using while Loop:

>>> str1 = ‘Hello World!’
>>> index = 0>>> while index < len(str1):
print(str1[index],end = ”)
index += 1
Hello World!

Here while loop runs till the condition index < len(str) is True, where index varies from 0 to len(str1) -1.

Strings in Python Class 11 Notes

String Methods and Built-in Functions

There are numerous built-in functions in Python that let us operate with strings. a few of the most popular built-in functions for manipulating strings.

len()

Returns the length of the given string

>>> str1 = ‘Hello World!’
>>> len(str1)
12

title()

Returns the string with first letter of every word in the string in uppercase and rest in lowercase

>>> str1 = ‘hello WORLD!’
>>> str1.title()
‘Hello World!’

lower()

Returns the string with all uppercase letters converted to lowercase

>>> str1 = ‘hello WORLD!’
>>> str1.lower()
‘hello world!’

upper()

Returns the string with all lowercase letters converted to uppercase

>>> str1 = ‘hello WORLD!’
>>> str1.upper()
‘HELLO WORLD!’

count(str, start, end)

Returns number of times substring str occurs in the given string. If we do not give start index and end index then searching starts from index 0 and ends at length of the string.

>>> str1 = ‘Hello World! Hello
Hello’
>>> str1.count(‘Hello’,12,25)
2
>>> str1.count(‘Hello’)
3

find(str, start, end)

Returns the first occurrence of index of substring str occurring in the given string. If we do not give start and end then searching starts from index 0 and ends at length of the string. If the substring is not present in the given string, then the function returns -1

>>> str1 = ‘Hello World! Hello Hello’
>>> str1.find(‘Hello’,10,20)
13
>>> str1.find(‘Hello’,15,25)
19
>>> str1.find(‘Hello’)
0
>>> str1.find(‘Hee’)
-1

index(str, start, end)

Same as find() but raises an exception if the substring is not present in the given string

>>> str1 = ‘Hello World! Hello
Hello’
>>> str1.index(‘Hello’)
0
>>> str1.index(‘Hee’)
ValueError: substring not found

Strings in Python Class 11 Notes

endswith()

Returns True if the given string ends with the supplied substring otherwise returns False

>>> str1 = ‘Hello World!’
>>> str1.endswith(‘World!’)
True
>>> str1.endswith(‘!’)
True
>>> str1.endswith(‘lde’)
False

startswith()

Returns True if the given string starts with the supplied substring otherwise returns False

>>> str1 = ‘Hello World!’
>>> str1.startswith(‘He’)
True
>>> str1.startswith(‘Hee’)
False

isalnum()

Returns True if characters of the given string are either alphabets or numeric. If whitespace or special symbols are part of the given string or the string is empty it returns False

>>> str1 = ‘HelloWorld’
>>> str1.isalnum()
True
>>> str1 = ‘HelloWorld2’
>>> str1.isalnum()
True
>>> str1 = ‘HelloWorld!!’
>>> str1.isalnum()
False

islower()

Returns True if the string is non-empty and has all lowercase alphabets, or has at least one character as lowercase alphabet and rest are non-alphabet characters

>>> str1 = ‘hello world!’
>>> str1.islower()
True
>>> str1 = ‘hello 1234’
>>> str1.islower()
True
>>> str1 = ‘hello ??’
>>> str1.islower()
True
>>> str1 = ‘1234’
>>> str1.islower()
False
>>> str1 = ‘Hello World!’
>>> str1.islower()
False

isupper()

Returns True if the string is non-empty and has all uppercase alphabets, or has at least one character as uppercase character and rest are non-alphabet characters

>>> str1 = ‘HELLO WORLD!’
>>> str1.isupper()
True
>>> str1 = ‘HELLO 1234’
>>> str1.isupper()
True
>>> str1 = ‘HELLO ??’
>>> str1.isupper()
True
>>> str1 = ‘1234’
>>> str1.isupper()
False
>>> str1 = ‘Hello World!’
>>> str1.isupper()
False

isspace()

Returns True if the string is non-empty and all characters are white spaces (blank, tab, newline, carriage return)

>>> str1 = ‘ \n \t \r’
>>> str1.isspace()
True
>>> str1 = ‘Hello \n’
>>> str1.isspace()
False

istitle()

Returns True if the string is non-empty and title case, i.e., the first letter of every word in the string in uppercase and rest in lowercase

>>> str1 = ‘Hello World!’
>>> str1.istitle()
True
>>> str1 = ‘hello World!’
>>> str1.istitle()
False

lstrip()

Returns the string after removing the spaces only on the left of the string

>>> str1 = ‘ Hello World!’
>>> str1.lstrip()
‘Hello World!

Strings in Python Class 11 Notes

rstrip()

Returns the string after removing the spaces only on the right of the string

>>> str1 = ‘ Hello World!’
>>> str1.rstrip()
‘ Hello World!’

strip()

Returns the string after removing the spaces both on the left and the right of the string

>>> str1 = ‘ Hello World!’
>>> str1.strip()
‘Hello World!’

replace(oldstr, newstr)

Replaces all occurrences of old string with the new string

>>> str1 = ‘Hello World!’
>>> str1.replace(‘o’,’*’)
‘Hell* W*rld!’
>>> str1 = ‘Hello World!’
>>> str1.replace(‘World’,’Country’)
‘Hello Country!’
>>> str1 = ‘Hello World! Hello’
>>> str1.replace(‘Hello’,’Bye’)
‘Bye World! Bye’

join()

Returns a string in which the characters in the string have been joined by a separator

>>> str1 = (‘HelloWorld!’)
>>> str2 = ‘-‘ #separator
>>> str2.join(str1)
‘H-e-l-l-o-W-o-r-l-d-!’

partition()

Partitions the given string at the first occurrence of the substring (separator) and returns the string partitioned into three parts.
1. Substring before the separator
2. Separator
3. Substring after the separator
If the separator is not found in the string, it returns the whole string itself and two empty strings

>>> str1 = ‘India is a Great Country’
>>> str1.partition(‘is’)
(‘India ‘, ‘is’, ‘ a GreatCountry’)
>>> str1.partition(‘are’)
(‘India is a Great Country’,’ ‘,”)

split()

Returns a list of words delimited by the specified substring. If no delimiter is given then words are separated by space.

>>> str1 = ‘India is a Great Country’
>>> str1.split()
[‘India’,’is’,’a’,’Great’, ‘Country’]
>>> str1 = ‘India is a Great Country’
>>> str1.split(‘a’)
[‘Indi’, ‘ is ‘, ‘ Gre’, ‘t Country’]

Strings in Python Class 11 Notes

Handling Strings

In this section, we’ll discover how to use user-defined functions in Python to manipulate strings in various ways.

Q. Write a program with a user defined function to count the number of times a character (passed as argument) occurs in the given string.

#Program 
#Function to count the number of times a character occurs in a
def charCount(ch,st):
count = 0
for character in st:
if character == ch:
count += 1
return count
st = input(“Enter a string: “)
ch = input(“Enter the character to be searched: “)
count = charCount(ch,st)
print(“Number of times character”,ch,”occurs in the string is:”,count)

Output:
Enter a string: Today is a Holiday
Enter the character to be searched: a
Number of times character a occurs in the string is: 3

Strings in Python Class 11 Notes

Q. Write a program with a user defined function with string as a parameter which replaces all vowels in the string with ‘*’.

#Program
#Function to replace all vowels in the string with ‘*’
def replaceVowel(st):
newstr = ”
for character in st:
if character in ‘aeiouAEIOU’:
newstr += ‘*’
else:
newstr += character
return newstr
st = input(“Enter a String: “)
st1 = replaceVowel(st)
print(“The original String is:”,st)
print(“The modified String is:”,st1)

Output:
Enter a String: Hello World
The original String is: Hello World
The modified String is: H*ll* W*rld

Q. Write a program to input a string from the user and print it in the reverse order without creating a new string.

#Program
#Program to display string in reverse order
st = input(“Enter a string: “)
for i in range(-1,-len(st)-1,-1):
print(st[i],end=”)

Output:
Enter a string: Hello World
dlroW olleH

Q. Write a program which reverses a string passed as parameter and stores the reversed string in a new string. Use a user defined function for reversing the string.

#Program
#Function to reverse a string
def reverseString(st):
newstr = ” #create a new string
length = len(st)
for i in range(-1,-length-1,-1):
newstr += st[i]
return newstr
#end of function
st = input(“Enter a String: “)
st1 = reverseString(st)
print(“The original String is:”,st)
print(“The reversed String is:”,st1)

Output:
Enter a String: Hello World
The original String is: Hello World
The reversed String is: dlroW olleH

Strings in Python Class 11 Notes

Q. Write a program using a user defined function to check if a string is a palindrome or not. (A string is called palindrome if it reads same backwards as forward. For example, Kanak is a palindrome.)

#Program
#Function to check if a string is palindrome or not
def checkPalin(st):
i = 0
j = len(st) – 1
while(i <= j):
if(st[i] != st[j]):
return False
i += 1
j -= 1
return True
#end of function
st = input(“Enter a String: “)
result = checkPalin(st)
if result == True:
print(“The given string”,st,”is a palindrome”)
else:
print(“The given string”,st,”is not a palindrome”)

Output 1:
Enter a String: kanak
The given string kanak is a palindrome
Output 2:
Enter a String: computer
The given string computer is not a palindrome

Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

error: Content is protected !!