THE PATH TO SUCCESS IN EXAM...
Introduction to Problem Solving – Notes
Introduction to problem solving.
- Steps for problem solving ( analysing the problem, developing an algorithm, coding, testing and debugging).
- flow chart and
- pseudo code,
Decomposition
Introduction
Computers is machine that not only use to develop the software. It is also used for solving various day-to-day problems.
Computers cannot solve a problem by themselves. It solve the problem on basic of the step-by-step instructions given by us.
Thus, the success of a computer in solving a problem depends on how correctly and precisely we –
- Identifying (define) the problem
- Designing & developing an algorithm and
- Implementing the algorithm (solution) do develop a program using any programming language.
Thus problem solving is an essential skill that a computer science student should know.
Steps for Problem Solving-
1. Analysing the problem
Analysing the problems means understand a problem clearly before we begin to find the solution for it. Analysing a problem helps to figure out what are the inputs that our program should accept and the outputs that it should produce.
2. Developing an Algorithm
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 algorithm.
Algorithm: A set of exact steps which when followed, solve the problem or accomplish the required task.
Coding is the process of converting the algorithm into the program which can be understood by the computer to generate the desired solution.
You can use any high level programming languages for writing a program.
4. Testing and Debugging
The program created should be tested on various parameters.
- The program should meet the requirements of the user.
- It must respond within the expected time.
- It should generate correct output for all possible inputs.
- In the presence of syntactical errors, no output will be obtained.
- In case the output generated is incorrect, then the program should be checked for logical errors, if any.
Software Testing methods are
- unit or component testing,
- integration testing,
- system testing, and
- acceptance testing
Debugging – The errors or defects found in the testing phases are debugged or rectified and the program is again tested. This continues till all the errors are removed from the program.
Algorithm is a set of sequence which followed to solve a problem.
Algorithm for an activity ‘riding a bicycle’: 1) remove the bicycle from the stand, 2) sit on the seat of the bicycle, 3) start peddling, 4) use breaks whenever needed and 5) stop on reaching the destination.
Algorithm for Computing GCD of two numbers:
Step 1: Find the numbers (divisors) which can divide the given numbers.
Step 2: Then find the largest common number from these two lists.
A finite sequence of steps required to get the desired output is called an algorithm. Algorithm has a definite beginning and a definite end, and consists of a finite number of steps.
Characteristics of a good algorithm
- Precision — the steps are precisely stated or defined.
- Uniqueness — results of each step are uniquely defined and only depend on the input and the result of the preceding steps.
- Finiteness — the algorithm always stops after a finite number of steps.
- Input — the algorithm receives some input.
- Output — the algorithm produces some output.
While writing an algorithm, it is required to clearly identify the following:
- The input to be taken from the user.
- Processing or computation to be performed to get the desired result.
- The output desired by the user.
Representation of Algorithms
There are two common methods of representing an algorithm —
Flowchart — Visual Representation of Algorithms
A flowchart is a visual representation of an algorithm. A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by arrows. Each shape represents a step of the solution process and the arrow represents the order or link among the steps. There are standardised symbols to draw flowcharts.
Start/End – Also called “Terminator” symbol. It indicates where the flow starts and ends.
Process – Also called “Action Symbol,” it represents a process, action, or a single step. Decision – A decision 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.
Input / Output – Also called data symbol, this parallelogram shape is used to input or output data.
Arrow – Connector to show order of flow between shapes.
Question: Write an algorithm to find the square of a number. Algorithm to find square of a number. Step 1: Input a number and store it to num Step 2: Compute num * num and store it in square Step 3: Print square
The algorithm to find square of a number can be represented pictorially using flowchart
A pseudocode (pronounced Soo-doh-kohd) is another way of representing an algorithm. It is considered as a non-formal language that helps programmers to write algorithm. It is a detailed description of instructions that a computer must follow in a particular order.
- It is intended for human reading and cannot be executed directly by the computer.
- No specific standard for writing a pseudocode exists.
- The word “pseudo” means “not real,” so “pseudocode” means “not real code”.
Keywords are used in pseudocode:
Question : Write an algorithm to calculate area and perimeter of a rectangle, using both pseudocode and flowchart.
Pseudocode for calculating area and perimeter of a rectangle.
INPUT length INPUT breadth COMPUTE Area = length * breadth PRINT Area COMPUTE Perim = 2 * (length + breadth) PRINT Perim The flowchart for this algorithm
Benefits of Pseudocode
- A pseudocode of a program helps in representing the basic functionality of the intended program.
- By writing the code first in a human readable language, the programmer safeguards against leaving out any important step.
- For non-programmers, actual programs are difficult to read and understand, but pseudocode helps them to review the steps to confirm that the proposed implementation is going to achieve the desire output.
Flow of Control :
The flow of control depicts the flow of process as represented in the flow chart. The process can flow in
In a sequence steps of algorithms (i.e. statements) are executed one after the other.
In a selection, steps of algorithm is depend upon the conditions i.e. any one of the alternatives statement is selected based on the outcome of a condition.
Conditionals are used to check possibilities. The program checks one or more conditions and perform operations (sequence of actions) depending on true or false value of the condition.
Conditionals are written in the algorithm as follows: If is true then steps to be taken when the condition is true/fulfilled otherwise steps to be taken when the condition is false/not fulfilled
Question : Write an algorithm to check whether a number is odd or even. • Input: Any number • Process: Check whether the number is even or not • Output: Message “Even” or “Odd” Pseudocode of the algorithm can be written as follows: PRINT “Enter the Number” INPUT number IF number MOD 2 == 0 THEN PRINT “Number is Even” ELSE PRINT “Number is Odd”
The flowchart representation of the algorithm
Repetitions are used, when we want to do something repeatedly, for a given number of times.
Question : Write pseudocode and draw flowchart to accept numbers till the user enters 0 and then find their average. Pseudocode is as follows:
Step 1: Set count = 0, sum = 0 Step 2: Input num Step 3: While num is not equal to 0, repeat Steps 4 to 6 Step 4: sum = sum + num Step 5: count = count + 1 Step 6: Input num Step 7: Compute average = sum/count Step 8: Print average The flowchart representation is
Once an algorithm is finalised, it should be coded in a high-level programming language as selected by the programmer. The ordered set of instructions are written in that programming language by following its syntax.
The syntax is the set of rules or grammar that governs the formulation of the statements in the language, such as spelling, order of words, punctuation, etc.
Source Code: A program written in a high-level language is called source code.
We need to translate the source code into machine language using a compiler or an interpreter so that it can be understood by the computer.
Decomposition is a process to ‘decompose’ or break down a complex problem into smaller subproblems. It is helpful when we have to solve any big or complex problem.
- Breaking down a complex problem into sub problems also means that each subproblem can be examined in detail.
- Each subproblem can be solved independently and by different persons (or teams).
- Having different teams working on different sub-problems can also be advantageous because specific sub-problems can be assigned to teams who are experts in solving such problems.
Once the individual sub-problems are solved, it is necessary to test them for their correctness and integrate them to get the complete solution.
- Input Output in Python
Related Posts
Society, Law, and Ethics: Societal Impacts – Notes
Data structure: stacks – notes.
Python Revision Tour I : Basics of Python – Notes
Introduction to Python Module – Notes
Sorting Techniques in Python – Notes
Dictionary handling in python – notes, tuples manipulation in python notes, list manipulation – notes, leave a comment cancel reply.
You must be logged in to post a comment.
You cannot copy content of this page
TutorialAICSIP
A best blog for CBSE Class IX to Class XII
Introduction to problem solving Computer Science Class 11 Notes
This article – introduction to problem solving Computer Science Class 11 offers comprehensive notes for Chapter 4 of the CBSE Computer Science Class 11 NCERT textbook.
Topics Covered
Introduction to problem solving Computer Science class 11
Computers, mobiles, the internet, etc. becomes our essentials nowadays for our routine life. We are using the to make our tasks easy and faster.
For example, earlier we were going to banks and standing in long queues for any type of transaction like money deposits or withdrawals. Today we can do these tasks from anywhere without visiting banks through internet banking and mobiles.
Basically, this was a complex problem and solved by a computer. The system was made online with the help of computers and the internet and made our task very easy.
This process is termed “Computerisations”. The problem is solved by using software to make a task easy and comfortable. Problem solving is a key term related to computer science.
The question comes to your mind how to solve a complex problem using computers? Let’s begin the article introduction to problem-solving Computer Science 11.
Introduction to problem solving Computer Science Class 11 – Steps for problem solving
“Computer Science is a science of abstraction -creating the right model for a problem and devising the appropriate mechanizable techniques to solve it.”
Solving any complex problem starts with understanding the problem and identifying the problem.
Suppose you are going to school by your bicycle. While riding on it you hear some noise coming from it. So first you will try to find that from where the noise is coming. So if you couldn’t solve the problem, you need to get it repaired.
The bicycle mechanic identifies the problem like a source of noise, causes of noise etc. then understand them and repair it for you.
So there are multiple steps involved in problem-solving. If the problem is simple and easy, we will find the solution easily. But the complex problem needs a few methods or steps to solve.
So complex problem requires some tools, a system or software in order to provide the solution. So it is a step-by-step process. These steps are as follows:
Analysing the problem
Developing an algorithm, testing and debugging.
The first step in the introduction to problem solving Computer Science Class 11 is analyzing the problem.
When you need to find a solution for a problem, you need to understand the problem in detail. You should identify the reasons and causes of the problem as well as what to be solved.
So this step involves a detailed study of the problem and then you need to follow some principles and core functionality of the solution.
In this step input and output, elements should be produced.
The second step for introduction to problem solving Computer Science class 11 is developing an algorithm.
An algorithm is a step-by-step process of a solution to a complex problem. It is written in natural language. An algorithm consists of various steps and begins from start to end. In between input, process and output will be specified. More details we will cover in the next section.
In short, the algorithm provides all the steps required to solve a problem.
For example:
Finding the simple interest, you need to follow the given steps:
- Gather required information and data such as principle amount, rate of interest and duration.
- Apply the formula for computing simple interest i.e. si=prn/100
- Now store the answer in si
- Display the calculated simple interest
In the above example, I have started and completed a task in a finite number of steps. It is completed in 4 finite steps.
Why algorithm is needed?
The algorithm helps developers in many ways. So it is needed for them for the following reasons:
- It prepares a roadmap of the program to be written before writing code.
- It helps to clearly visualise the instructions to be given in the program.
- When the algorithm is developed, a programmer knows the number of steps required to follow for the particular task.
- Algorithm writing is the initial stage (first step) of programming.
- It makes program writing easy and simple.
- It also ensures the accuracy of data and program output.
- It increases the reliability and efficiency of the solution.
Characteristics of a good algorithm
The characteristics of a good algorithm are as follows:
- It starts and ends with a finite number of steps. Therefore the steps are precisely stated or defined.
- In the algorithm, the result of each step is defined uniquely and based on the given input and process.
- After completion of the task, the algorithm will end.
- The algorithm accepts input and produces the output.
While writing the algorithm the following things should be clearly identified:
- The input required for the task
- The computation formula or processing instructions
After writing the algorithm, it is required to represent it. Once the steps are finalised, it is required to be represented logically. This logical representation of the program clearly does the following:
- Clears the logic of the program
- The execution of the program
The algorithm is steps written in the form of text. So it is difficult to read sometimes. So if it is represented in pictorial form it would be better for analysis of the program.
The flowchart is used to represent the algorithm in visual form.
Flowchart – Visual representation of an algorithm
A flowchart is made of some symbols or shapes like rectangles, squares, and diamonds connected by arrows. Every shape represents each step of an algorithm. The arrow basically represents the order or link of the steps.
The symbols used in the flow chart are as follows:
Coding is an essential part of the introduction to problem solving ComputerScience11.
- It is pronounced as soo-doh-kohd
- It is one of the ways of representing algorithms in a systematic way
- The word pseudo means not real, therefore pseudocode means not real code
- It is non-formal language, that helps programmers to write code
- It is written in human understandable language
- It cannot be directly read by computers
- There is no specific standard or way of writing pseudocode is there
When an algorithm is prepared, the next step is writing code. This code will be written in a specific programming language. The code follows certain rules and regulations of the programing language and provides solutions.
When coding is done you need to maintain it with proper documentation as well. The best practices for coding procedures must be followed. Because this code can be reviewed a number of times for further development and upgradation.
Let’s understand this step with a simple example!!
When your mother prepares a cake at your home, she will give peace of cake to someone before serving it to check the taste of the cake, right!!! If anything is needed like sugar or softness or hardness should be improved she will decide and do the improvement.
Similarly after writing code testing and debugging are required to check the software whether is providing the solution in a good manner not.
Have look at this also: Computer Science Class XI
Share this:
- Click to share on WhatsApp (Opens in new window)
- Click to share on Telegram (Opens in new window)
- Click to share on Facebook (Opens in new window)
- Click to share on Twitter (Opens in new window)
- Click to share on LinkedIn (Opens in new window)
By Sanjay Parmar
More on this, computer science class 11 sample paper 2023-24 comprehensive guide, split up syllabus computer science class 11 comprehensive guide, comprehensive notes types of software class 11, leave a reply cancel reply.
You must be logged in to post a comment.
- Class 6 Maths
- Class 6 Science
- Class 6 Social Science
- Class 6 English
- Class 7 Maths
- Class 7 Science
- Class 7 Social Science
- Class 7 English
- Class 8 Maths
- Class 8 Science
- Class 8 Social Science
- Class 8 English
- Class 9 Maths
- Class 9 Science
- Class 9 Social Science
- Class 9 English
- Class 10 Maths
- Class 10 Science
- Class 10 Social Science
- Class 10 English
- Class 11 Maths
- Class 11 Computer Science (Python)
- Class 11 English
- Class 12 Maths
- Class 12 English
- Class 12 Economics
- Class 12 Accountancy
- Class 12 Physics
- Class 12 Chemistry
- Class 12 Biology
- Class 12 Computer Science (Python)
- Class 12 Physical Education
- GST and Accounting Course
- Excel Course
- Tally Course
- Finance and CMA Data Course
- Payroll Course
Interesting
- Learn English
- Learn Excel
- Learn Tally
- Learn GST (Goods and Services Tax)
- Learn Accounting and Finance
- GST Tax Invoice Format
- Accounts Tax Practical
- Tally Ledger List
- GSTR 2A - JSON to Excel
Are you in school ? Do you love Teachoo?
We would love to talk to you! Please fill this form so that we can contact you
You are learning...
Chapter 4 Class 11 - Introduction to Problem Solving
Click on any of the links below to start learning from Teachoo ...
Do you want to learn how to solve problems using computers? Do you want to develop your logical thinking and programming skills ? Do you want to explore the fascinating world of algorithms and data structures ? If you answered yes to any of these questions, then this chapter is for you! 🙌
In this chapter, you will learn about the basic concepts and techniques of problem solving using computers. You will learn how to:
- Define a problem and its specifications 📝
- Analyze a problem and identify its inputs, outputs and processing steps 🔎
- Design an algorithm to solve a problem using various methods such as pseudocode, flowcharts and decision tables 📊
- Implement an algorithm using a programming language such as Python 🐍
- Test and debug your program to ensure its correctness and efficiency 🛠️
- Evaluate your solution and compare it with other possible solutions 💯
By the end of this chapter, you will be able to apply your problem solving skills to various domains such as mathematics, science, engineering, games, art and more. You will also be able to appreciate the beauty and elegance of algorithms and data structures, and how they can help you solve complex and challenging problems. 😍
This chapter is designed for students who have some basic knowledge of computers and programming, but want to improve their problem solving abilities. It is also suitable for anyone who is interested in learning more about computer science and its applications. 🚀
MCQ questions (1 mark each)
True or false questions (1 mark each), fill in the blanks questions (1 mark each), very short answer type questions (1 mark each), short answer type questions (2 marks each), long answer type questions (3 marks each).
What's in it?
Hi, it looks like you're using AdBlock :(
Please login to view more pages. it's free :), solve all your doubts with teachoo black.
Python Fundamentals Class 11 Notes | Getting Started with Python
latest Python Fundamentals Class 11 Notes designed for CBSE Computer Science student covering all concepts concisely to get full marks. This Post cum notes is specially covers Chapter 5 Getting started with Python of NCERT Computer Science Class 11 as per CBSE suggested syllabus.
Introduction to Python
Python is a General Purpose high level Programming language used for developing application softwares.
- 1 Features of Python
- 2 Important Programming Terminologies
- 3.1 Interactive Mode
- 3.2 Script Mode
- 4 How to execute or run python program
- 5 Python Keywords
- 6 Identifier
- 7 Variables
- 8 Data types
- 9.1 Arithmetic Operator
- 9.2 Relational Operator
- 9.3 Assignment Operator
- 9.4 Logical Operator
- 9.5 Identity Operator
- 9.6 Membership Operator
- 10 Operator Precedence
- 11.1 Evaluation of Expression
- 12 Statement
- 13 How to input values in python?
- 14 How to display output in python
- 15.1 Explicit Conversion
- 15.2 Implicit conversion
- 16.1 Errors
- 16.2 Types of error
- 16.3 Syntax Errors
- 16.4 Logical Error
- 16.5 Runtime Error
Features of Python
- Free and Open Source
- Case Sensitive
- Interpreted
- Plateform Independent
- Rich library of functions
- General Purpose
Important Programming Terminologies
Instructions : A single step written to carry out an action
Programs: Set of Instructions
Software: Set of Programs
Source Code: A program written in High Level Language
Machine Code: set of instructions in form of binary language (0 and 1) which is understood by computer
Compiler: program which converts code written in high level language into machine language
Interpreter: it is also a program which converts code written in high level language into machine language. An interpreter processes the instructions one by one.
Working with Python
To write and run python programs we need Python Interpreter also called Python IDLE.
Execution Mode
We can use Python Interpreter in two ways:
- Interactive mode
- Script mode
Interactive Mode
- Instant execution of individual statement
- Convenient for testing single line of code
- We cannot save statements for future use
Script Mode
- Allows us to write and execute more than one Instruction together.
- We can save programs (python script) for future use
- Python scripts are saved as file with extension “.py”
How to execute or run python program
- Open python IDLE
- Click ‘File’ and select ‘New’ to open Script mode
- Type source code and save it
- Click on ‘Run’ menu and select ‘Run Module’
Python Keywords
- These are predefined words which a specific meaning to Python Interpreter.
- These are reserve keywords
- Keywords in python are case sensitive
Identifiers are name used to identify a variable, function or any other entities in a programs.
Rules for naming Identifier
- The name should begin with an alphabet or and underscore sign and can be followed by any combination of charaters a-z, A-Z, 0-9 or underscore.
- It can be of any length but we should keep it simple, short and meaningful.
- it should not be a python keyword or reserved word.
- We cannot use special symbols like !, @, #, $, % etc. in identifiers.
- It can be referred as an object or element that occupies memory space which can contain a value.
- Value of variable can be numeric, alphanumeric or combination of both.
- In python assignment statement is used to create variable and assign values to it.
These are keywords which determine the type of data stored in a variable. Following table show data types used in python:
- These are statement ignored by python interpreter during execution.
- It is used add a remark or note in the source code.
- It starts with # (hash sign) in python.
These are special symbols used to perform specific operation on values. Different types of operator supported in python are given below:
- Arithmetic operator
- Relational operator
- Assignment operator
- Logical operator
- Identity operator
- Membership operator
Arithmetic Operator
Relational Operator
Assignment Operator
Logical Operator
Identity Operator
Membership Operator
Operator Precedence
Expressions
- An expression is combination of different variables, operators and constant which is always evaluated to a value.
- A value or a standalone variable is also considered as an expression.
- 41 + 3*11 – 77/7
- “techtipnow” + “computers”
Evaluation of Expression
23 + 12 + 18
Evaluation:
= (23 + 12) + 18 #step1 = 35 + 18 #step2 = 53 #step3
56 + (23-13) + 89%8 – 2*3
= 56 + (23 -13) + 89%8 – 2*3 #step1 = 56 + 10 + (89%8) – 2*3 #step2 = 56 + 10 + 1 – (2*3) #step3 = (56 + 10) + 1 – 6 #step4 = (66 + 1) – 6 #step5 = 67 – 6 #step6 = 61
A statement is unit of code that the python interpreter can execute.
- var1 = var2 #assignment statement
- x = input (“enter a number”) #input statement
- print (“total = “, R) #output statement
How to input values in python?
In python we have input() function for taking user input.
Input([primpt])
How to display output in python
In python we have print() function to display output.
print([message/value])
python program to input and output your name
var = input(“Enter your name”) print(“Name you have entered is “, var)
Example: Addition of two numbers
Var1 = int(input(“enter no1”)) Var2 = int(input(“enter no2”)) Total = Var1 + Var2 Print(“Total = “, Total)
Example: Program to convert degree Celsius into Fahrenheit
C = float (“Enter degree in Celsius”)) F = (9*C) /5 + 32 print (“Degree in Fahrenheit = , F)
Type Conversion
- Type conversion refers to converting one type of data to another type.
- Explicit conversion
Implicit conversion
Explicit conversion.
- Explicit conversion also refers to type casting.
- In explicit conversion, data type conversion is forced by programmer in program
(new_data_type) = (expression)
Example: Program of explicit type conversion from float to int
x = 12 y = 5 print(x/y) #output – 2.4 print(int(x/y)) #output – 2
program of explicit type conversion from string to int
x = input(“enter a number”) print(x+2) #output – produce error “can only concatenate str to str x = int (input(Enter a number”)) print(x+2) #output – will display addition of value of x and 2
program of explicit type conversion from string to float
x = ’10.2’ y = ’12.3’ r = x+y print(r) #output – 10.212.3 r = float(x) + float(y) print(r) #output – 22.5
- Implicit conversion is also known as coercion
- In implicit conversion data type conversion is done automatically.
- Implicit conversion allows conversion from smaller data type to wider size data type without any loss of information
Example: Program to show implicit conversion from int to float
var1 = 10 #var1 is integer var2 = 3.4 #var2 is float res = var1 – var2 #res becomes float automatically after subtraction print(res) #output – 6.6 print(type(res)) #output – class ‘Float’
Process of identifying and removing errors (also called bugs) produced in program is called debugging.
Error refers to mistake that occurs while writing a program and due to which program may not execute or may not generate desired output.
Types of error
Errors occurring in programs can be categorized as :
- Syntax error
- Logical error
- Runtime error
Syntax Errors
- Syntax errors refers to writing code against programming rules of python such as using wrong function name, wrong indentation, wrong expressions etc.
- Program can not be executed until it is syntactically incorrect
- (7 + 11 #absence of right bracket
- X = inpt(“enter a number”) #wrong function name
- If x>y: print(x) #wrong indentation
Logical Error
Logical errors refers to
- Incorrect execution of program
- Not producing desired output
If x==’a’ or ‘e’ or ‘i’ or ‘o’ or ‘u’: #line1 : Logical Error print(“Vowel”) Else: Print(“Consonant”)
#line1 : is logically written wrong as the program will only display ‘a’ as vowel and rest will be displayed as consonant, because they will not be compared. It should be written as:
If x==’a’ or x==’e’ or x==’i’ or x==’o’ or x==’u’: print(“Vowel”) Else: Print(“Consonant”)
Runtime Error
Runtime Error causes abrupt termination of program during its execution. It appears during execution of program only.
Example: “Division by zero”
x = int(input(“Enter Dividend”)) y = int(input(“Enter Divisor”)) print(x/y) #if user enter 0 in y, it generate runtime error and program is terminated abruptly
Leave a Comment Cancel Reply
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.
- Why Python?
- The Anaconda Distribution of Python
- Installing Anaconda on Windows
- Installing Anaconda on MacOS
- Installing Anaconda on Linux
- Installing Python from Python.org
- Review Questions
Orientation
Introduction.
Welcome to the world of problem solving with Python! This first Orientation chapter will help you get started by guiding you through the process of installing Python on your computer. By the end of this chapter, you will be able to:
Describe why Python is a useful computer language for problem solvers
Describe applications where Python is used
Detail advantages of Python over other programming languages
Know the cost of Python
Know the difference between Python and Anaconda
Install Python on your computer
Install Anaconda on your computer
Getting Started with Python Class 11 Notes
Teachers and Examiners ( CBSESkillEduction ) collaborated to create the Getting Started with Python Class 11 Notes . All the important Information are taken from the NCERT Textbook Computer Science (083) class 11 .
Python is a high-level, object-oriented programming language. Python is frequently considered as one of the simplest programming languages to learn for beginners. Python’s simple syntax prioritizes readability and makes it simple to learn, which lowers the cost of programme maintenance. Python’s support for modules and packages promotes the modularity and reuse of code in programmes. For all popular platforms, the Python interpreter and the comprehensive standard library are freely distributable and available in source or binary form.
Features of Python
- Python is a high-level language. It is a free and open-source language.
- It is an interpreted language, as Python programs are executed by an interpreter.
- Python programs are easy to understand as they have a clearly defined syntax and relatively simple structure.
- Python is case-sensitive. For example, NUMBER and number are not same in Python.
- Python is portable and platform independent, means it can run on various operating systems and hardware platforms.
- Python has a rich library of predefined functions.
- Python is also helpful in web development. Many popular web services and applications are built using Python.
- Python uses indentation for blocks and nested blocks.
Working with Python
We require a Python interpreter installed on our computer or we can utilise any online Python interpreter in order to create and run (execute) a Python programme. The Python shell is another name for the interpreter. diagram
The Python prompt, represented by the symbol >>> in the screenshot above, indicates that the interpreter is prepared to accept commands.
Execution Modes
There are two ways to use the Python interpreter: a) Interactive mode b) Script mode
Interactive Mode
Programmers can quickly run the commands and try out or test code without generating a file by using the Python interactive mode, commonly known as the Python interpreter or Python shell. To work in the interactive mode, we can simply type a Python statement on the >>> prompt directly. It’s practical to test one line of code for immediate execution while working in interactive mode.
Script Mode
In the script mode, a Python programme can be written in a file, saved, and then run using the interpreter. Python scripts are stored in files with the “.py” extension. Python scripts are saved by default in the Python installation folder.
Python Keywords
Keywords are reserved words. Each keyword has a specific meaning to the Python interpreter, and we can use a keyword in our program only for the purpose for which it has been defined. As Python is case sensitive, keywords must be written exactly.
Identifiers
Identifiers are names used in programming languages to identify a variable, function, or other things in a programme. Python has the following guidelines for naming an identifier: a. The name should begin with an uppercase or a lowercase alphabet or an underscore sign (_). b. It can be of any length. c. It should not be a keyword or reserved word. d. We cannot use special symbols like !, @, #, $, %, etc.
A variable’s name serves as a program’s unique identifier (identifier). In Python, the term “variable” refers to an object, which is a thing or things that is kept in memory. A variable’s value can be a string, such as “b,” or a number, such as “345,” or any combination of alphanumeric characters (CD67). In Python, we can create new variables and give them particular values by using an assignment statement.
gender = ‘M’ message = “Keep Smiling” price = 987.9
In the source code, comments are used to add remarks or notes. The interpreter doesn’t carry out comments. They are included to make the source code simpler for individuals to understand. comments always start from #.
Example #Add your python comments
Everything is an Object
Python treats every type of object, including variables, functions, lists, tuples, dictionaries, sets, etc., as an object. Each item belongs to a particular class. An integer variable, for instance, is a member of the integer class. An item is a physical thing. A collection of various data and functions that work with that data is an object.
In Python, each value corresponds to a certain data type. A variable’s data type describes the kinds of data values it can store and the types of operations it can execute on that data. The data types that Python.
Only numerical values are stored in the Number data type. Three other categories are used to further categories it: int, float, and complex.
An ordered group of things, each of which is identified by an integer index, is referred to as a Python sequence. Strings, Lists, and Tuples are the three different forms of sequence data types that are available in Python.
- String – A string is a collection of characters. These characters could be letters, numbers, or other special characters like spaces. Single or double quotation marks are used to surround string values for example, ‘Hello’ or “Hello”).
- List – List is a sequence of items separated by commas and the items are enclosed in square brackets [ ]. example list1 = [5, 3.4, “New Delhi”, “20C”, 45]
- Tuple – A tuple is a list of elements enclosed in parenthesis and separated by commas ( ). Compared to a list, where values are denoted by brackets [], this does not. We cannot alter the tuple once it has been formed. example tuple1 = (10, 20, “Apple”, 3.4, ‘a’)
A set is a group of elements that are not necessarily in any particular order and are enclosed in curly brackets. The difference between a set and a list is that a set cannot include duplicate entries. A set’s components are fixed once it is constructed. examle set1 = {10,20,3.14,”New Delhi”}
A unique data type with only one value is called None. It is employed to denote a situation’s lack of worth. None is neither True nor False, and it does not support any special operations (zero). example myVar = None
Python has an unordered data type called mapping. Python currently only supports the dictionary data type as a standard mapping data type.
- Dictionary – Python’s dictionary stores data elements as key-value pairs. Curly brackets are used to surround words in dictionaries. Dictionary use enables quicker data access. example, dict1 = {‘Fruit’:’Apple’, ‘Climate’:’Cold’, ‘Price(kg)’:120}
Mutable and Immutable Data Types
Once a variable of a certain data type has been created and given values, Python does not enable us to modify its values. Mutable variables are those whose values can be modified after they have been created and assigned. Immutable variables are those whose values cannot be modified once they have been created and assigned.
Deciding Usage of Python Data Types
When we need a straightforward collection of data that can be modified frequently, lists are chosen. For example, it is simple to update a list of student names when some new students enrol or some students drop out of a class. When there is no requirement for data modification, we use tuples. For instance, the names of the months of a year.
A specific mathematical or logical operation on values is performed using an operator. Operands are the values that the operators manipulate. As an illustration, the operands of the phrase 10 + num are the number 10 and the variable num, and the operator is the plus symbol (+).
Arithmetic Operators
The four fundamental arithmetic operations, as well as modular division, floor division, and exponentiation, are all supported by Python’s arithmetic operators.
Relational Operators
A relational operator establishes the relationship between the operands by comparing their values on either side.
Assignment Operators
Assignment operator assigns or changes the value of the variable on its left.
Logical Operators
Python is compatible with three logical operators. Only lower case letters may be used to write these operators (and, or, not).
Identity Operators
Identity operators are used to determine whether or not a variable’s value belongs to a particular type. To determine whether two variables are referring to the same object or not, identity operators can also be utilised. Two identity operators are available.
Membership Operators
Membership operators are used to check if a value is a member of the given sequence or not.
Expressions
A mixture of constants, variables, and operators is referred to as an expression. An expression will always yield a value. An expression can either be a value or a standalone variable, but a standalone operator is not an expression. Below are a few instances of legitimate expressions.
Precedence of Operators
The order in which an operator is applied in an expression where there are several types of operators is determined by its precedence. The operator with a higher precedence is evaluated before the operator with a lower precedence.
In Python, a statement is a unit of code that the Python interpreter can execute.
x = 4 #assignment statement cube = x ** 3 #assignment statement print (x, cube) #print statement 4 64
Input and Output
The user is prompted to provide data using the input() function. All user input is accepted as strings. Although the input() function only accepts strings, the user may enter either a number or a string. input() has the following syntax:
input ([Prompt])
Prompt is an optional string that we could choose to display on the screen before accepting input. When a prompt is specified, it is first shown to the user on the screen before data entry is allowed. The input() function accepts the text entered directly from the keyboard, turns it to a string, and then assigns it to the variable to the left of the assignment operator (=). Pressing the enter key ends data entry for the input function.
fname = input(“Enter your first name: “) Enter your first name: Arnab age = input(“Enter your age: “) Enter your age: 19 type(age)
Python’s print() method outputs data to the screen, which is the standard output device. Before printing the expression, the print() function evaluates it.
Type Conversion
An object can be converted from one data type to another using typecasting, also known as type conversion. It is employed in computer programming to guarantee that a function processes variables appropriately. Converting an integer to a string is an illustration of typecasting. There are two type of conversion –
Explicit Conversion
Implicit conversion.
Data type conversion that occurs because the programmer actively implemented it in the programme is referred to as explicit conversion, also known as type casting. An explicit data type conversion can take the following general forms:
(new_data_type) (expression)
Type Conversion between Numbers and Strings
priceIcecream = 25 priceBrownie = 45 totalPrice = priceIcecream + priceBrownie print(“The total is Rs.” + totalPrice )
When Python converts data types automatically without a programmer’s instruction, this is referred to as implicit conversion, also known as coercion.
Implicit type conversion from int to float
num1 = 10 #num1 is an integer num2 = 20.0 #num2 is a float sum1 = num1 + num2 #sum1 is sum of a float and an integer print(sum1) print(type(sum1))
A programmer’s errors can prevent a programme from running properly or from producing the intended results. Debugging is the process of finding and fixing these flaws, sometimes referred to as bugs or errors, in a software. Program errors can be categorised as follows:
- Syntax errors
- Logical errors
- Runtime errors
Syntax Errors
The syntax of Python is determined by its own rules. Only correctly syntactical statements—those that adhere to Python’s rules—are interpreted by the interpreter. The interpreter displays any syntax errors and terminates the execution at that point. For example, parentheses must be in pairs, so the expression (10 + 12) is syntactically correct, whereas (7 + 11 is not due to absence of right parenthesis.
Logical Errors
A programme defect that results in improper behaviour is known as a logical error. A logical mistake results in an undesirable output without immediately stopping the program’s execution. It can be challenging to spot these issues because the programme interprets correctly even though it contains logical faults.
For example, if we wish to find the average of two numbers 10 and 12 and we write the code as 10 + 12/2, it would run successfully and produce the result 16. Surely, 16 is not the average of 10 and 12. The correct code to find the average should have been (10 + 12)/2 to give the correct output as 11.
Runtime Error
A runtime fault results in an unexpected programme termination while it is running. When a statement is syntactically correct but unable to be executed by the interpreter, it is said to have a runtime error. Runtime errors do not show up until the programme has begun to run or execute.
For example, we have a statement having division operation in the program. By mistake, if the denominator entered is zero then it will give a runtime error like “division by zero”.
Computer Science Class 11 Notes
- Unit 1 : Basic Computer Organisation
- Unit 1 : Encoding Schemes and Number System
- Unit 2 : Introduction to problem solving
- Unit 2 : Getting Started with Python
- Unit 2 : Conditional statement and Iterative statements in Python
- Unit 2 : Function in Python
- Unit 2 : String in Python
- Unit 2 : Lists in Python
- Unit 2 : Tuples in Python
- Unit 2 : Dictionary in Python
- Unit 3 : Society, Law and Ethics
Computer Science Class 11 MCQ
Computer science class 11 ncert solutions.
- Unit 2 : Tuples and Dictionary in Python
- Education Diary
- Advertising
- Privacy Policy
Class Notes NCERT Solutions for CBSE Students
Introduction To Python: 11th Computer Science Chapter 01
admin June 9, 2022 11th Class , Computer Science 1,330 Views
1.1 Introduction:
- General-purpose Object Oriented Programming language.
- High-level language
- Developed in late 1980 by Guido van Rossum at National Research Institute for Mathematics and Computer Science in The Netherlands .
- It is derived from programming languages such as ABC, Modula 3, small talk, Algol68.
- It is Open Source Scripting language.
- It is Case-sensitive language (Difference between uppercase and lowercase letters).
- One of the official languages at Google .
1.2 Characteristics of Python:
- Interpreted: Python source code is compiled to byte code as a .pyc file, and this byte code can be interpreted by the interpreter.
- Interactive
- Object Oriented Programming Language
- Easy & Simple
- Scalable: Provides improved structure for supporting large programs.
- Expressive Language
1.3 Python Interpreter:
Names of some Python interpreters are:
- Python IDLE
- The Python Bundle
- Sublime Text etc.
There are two modes to use the python interpreter:
- Interactive Mode
- Script Mode
Interactive Mode:
Without passing python script file to the interpreter, directly execute code to Python (Command line).
Example: >>> 6+3 Output: 9
Note: >>> is a command the python interpreter uses to indicate that it is ready. The interactive mode is better when a programmer deals with small pieces of code.
To run a python file on command line:
exec(open(“C:\Python33\python programs\program1.py”).read( ))
Script Mode:
In this mode source code is stored in a file with the .py extension and use the interpreter to execute the contents of the file. To execute the script by the interpreter, you have to tell the interpreter the name of the file.
If you have a file name Demo.py, to run the script you have to follow the following
Step 1: Open the text editor i.e. Notepad Step 2: Write the python code and save the file with .py file extension. (Default directory is C:\Python33/Demo.py) Step 3: Open IDLE ( Python GUI) python shell Step 4: Click on file menu and select the open option Step 5: Select the existing python file Step 6: Now a window of python file will be opened Step 7: Click on Run menu and the option Run Module. Step 8: Output will be displayed on python shell window.
- Stumbleupon
Tags CBSE Class 11 Computer Science Solutions CBSE Class 11 NCERT Solutions CBSE Class 12 Computer Science Solutions CBSE Class 12 NCERT Solutions Free Class 11 Computer Science Solutions Free Class 12 Computer Science Solutions Free NCERT Online Solutions NCERT Books Online Solutions NCERT CBSE Class 11 Computer Science Solutions NCERT CBSE Class 12 Computer Science Solutions NCERT CBSE Solutions NCERT Class 11 Computer Science Chapter NCERT Class 11 Computer Science Solutions NCERT Class 12 Computer Science Chapter NCERT Class 12 Computer Science Solutions NCERT Solution for Class 11 Computer Science Chapter NCERT Solution for Class 12 Computer Science Chapter NCERT Solutions NCERT Solutions for Class 11 Computer Science Solutions NCERT Solutions for Class 12 Computer Science Solutions
Related Articles
CBSE Class 9 Computer Applications Syllabus 2024
December 9, 2023
Applied Mathematics Class 11 Syllabus 2024
November 29, 2023
Flow of Control: 11th Computer Science Chapter 04
June 25, 2023
Data Handling: 11th Computer Science Chapter 03
Dictionary in python: 11th class computer science chapter 09.
November 11, 2022
Tuple in Python: 11th Class Computer Science Chapter 08
November 10, 2022
List in Python: 11th Class Computer Science Chapter 07
Chapter Name: List in Python [Chapter 07] Class: 11th Subject: Computer Science 7.1 Introduction: List …
- School Guide
- Class 11 Syllabus
- Class 11 Revision Notes
- Maths Notes Class 11
- Physics Notes Class 11
- Chemistry Notes Class 11
- Biology Notes Class 11
- NCERT Solutions Class 11 Maths
- RD Sharma Solutions Class 11
- Math Formulas Class 11
- NCERT Notes for Class 11 Biology Chapter 19: Chemical Coordination and Integration
- NCERT Solutions for Class 10 Geography Social Science Chapter 1 : Resource and Development
- Importance of Sustainable Development
- Discuss the Meaning of Discounting Bills of Exchange
- CBSE Class 10 Geography Notes Chapter 3 : Water Resources
- What is the Difference between Temperate and Tropical Regions?
- Important Formulas in Statistics for Economics | Class 11
- Business Ethics : Meaning, Benefits and Elements
- Types of Industries- Primary, Secondary, and Tertiary
- Nature and Types of Services
- Services offered by Retailers
- MSME and Business Entrepreneurship
- Introduction to Microeconomics
- International Business : Meaning, Scope and Benefits
- Private, Public, and Global Enterprises
- Introduction to Emerging Modes of Business
- Statistics for Economics | Functions, Importance, and Limitations
- Steps in the Formation of a Company
- Doppler Effect - Definition, Formula, Examples
Types of Remote Sensing| Class 11 Geography Notes
Class 11 Geography Notes: Achieving success in CBSE exams requires a clear understanding of Geography concepts. Thus, Class 11 students must obtain well-structured Geography Class 11 Notes from experienced teachers. These notes are designed to help students understand the fundamental concepts of Geography and build a strong foundation for their future studies.
Our Geography Notes for Class 11 are a helpful resource to improve problem-solving skills and prepare for Social Science Class 11 exams. By using our detailed notes, students can strengthen their understanding of Geography and become better at solving problems.
What is Remote Sensing?
Remote sensing is a technology that gathers information about the Earth’s surface without making direct contact. It involves sensing and recording energy reflections or emissions, and then processing, analyzing, and using that data. Special cameras are used to collect images from objects on Earth, which are then analyzed to provide information about the planet.
In simple terms, remote sensing is about gathering information from objects on Earth using satellites. It involves recording energy reflections or emissions and then analyzing and applying that information.
There are many remote sensing satellites launched by various countries, such as the Indian Remote Sensing Satellite (IRS), Sputnik 1 from Russia, and Explorer 1 from the USA. These satellites help measure the radiation emitted and reflected by different regions, enabling scientists to monitor the Earth’s physical properties from afar.
For instance, sonar equipment on ships can capture images of the seafloor without diving into the ocean. Remote sensing can track changes in agriculture, forests, and urban areas over time, providing valuable insights for various purposes.
Types of Remote Sensing
Remote sensing refers to the technology of gathering information about the Earth’s surface without direct physical contact. There are two main types of remote sensing:
- Passive sensors
- Active sensors
Passive Sensors
Passive sensors detect natural energy (radiation) emitted or reflected by the object or scene being observed. The most common source of radiation measured by passive sensors is reflected sunlight. In contrast, sensing done via active sensors is called active sensing, for which they often require additional electrical power for excitation. Passive sensors can only detect the energy that naturally occurs, and they gather data during the day when electromagnetic energy is available.
Unlike active sensors, passive sensors do not emit energy and instead wait for data requests. They are vulnerable to external disturbances. The transducer of a passive sensor causes a change in a passive electrical quantity such as capacitance, resistance, or inductance as a result of the stimulation.
Passive sensors measure using electromagnetic radiation that is naturally emitted within their field of view. Examples of passive sensors include satellites used for remote sensing, such as SPOT-1 and LANDSAT-1.
Active Sensors
Active sensors transmit their own signal and measure the energy that is reflected, transmitted back, or scattered back from the target. Examples include radar and sonar. Sensing done via passive sensors is called passive sensing. An active sensor’s transducer directly produces electric current or voltage in response to external stimulus. It generates its own electromagnetic (EM) energy, sends it toward the Earth, and then collects the energy reflected back from the planet. Electromagnetic (EM) radiation received is used for measurement.
Active sensors can self-destruct during hijack attempts and can take measurements at any time. They measure and transmit electromagnetic energy. Unlike passive sensors, active sensors actively communicate measurements to ground stations regardless of whether the on-duty employees want the data or not. They provide their own energy source for illumination. Examples of active sensors include communication satellites, earth observation satellites, and LISS-1.
Remote sensing involves two main types: passive and active sensing. Passive sensors detect natural energy, like sunlight, while active sensors emit their own signals and measure the energy reflected back.
Both methods are vital for gathering information about Earth’s surface, aiding in tasks like monitoring the environment and planning cities. Understanding these methods helps in using remote sensing effectively for various purposes.
Related Links
- CBSE Class 9 Geography Revision Notes
- CBSE Notes Class 10 Geography Chapter 1- Resources and Development
- CBSE Notes Class 10 Geography Chapter 4 – Agriculture
FAQs on Class 11 Geography Types of Remote Sensing
What is remote sensing.
Remote sensing is the process of acquiring information about an object, area, or phenomenon from a distance from satellites or aircraft, without making physical contact.
What are the different types of remote sensing?
There are two main types of remote sensing: passive remote sensing and active remote sensing.
How does passive remote sensing work?
Passive remote sensing detects natural energy (radiation) emitted or reflected by the object being observed, such as sunlight. Sensors measure this radiation without emitting their own energy.
How does active remote sensing work?
Active remote sensing involves sensors that transmit their own signal towards the Earth’s surface and measure the energy reflected or scattered back. Examples include radar and sonar.
What are the applications of remote sensing in geography?
Remote sensing has various applications in geography, including land cover mapping, urban planning, environmental monitoring, agriculture, disaster management, and resource exploration.
Please Login to comment...
Similar reads.
- Chapterwise-Notes-Class-11
- School Geography
- Social Science
- 10 Best Free Note-Taking Apps for Android - 2024
- 10 Best VLC Media Player Alternatives in 2024 (Free)
- 10 Best Free Time Management and Productivity Apps for Android - 2024
- 10 Best Adobe Illustrator Alternatives in 2024
- 30 OOPs Interview Questions and Answers (2024)
IMAGES
VIDEO
COMMENTS
Steps for problem solving. There are 4 basic steps involved in problem solving. Analyze the problem. Developing an algorithm. Coding. Testing and debugging. Analyze the problem. Analyzing the problem is basically understanding a problem very clearly before finding its solution. Analyzing a problem involves.
Step 1: Find the numbers (divisors) which can divide the given numbers. Step 2: Then find the largest common number from these two lists. A finite sequence of steps required to get the desired output is called an algorithm. Algorithm has a definite beginning and a definite end, and consists of a finite number of steps.
Problem fixing starts with the accurate identification of the issue and concludes with a fully functional programme or software application. Program Solving Steps are -. 1. Analysing the problem. 2. Developing an Algorithm. 3. Coding.
🚀This video Unlock the Power of Problem Solving! 💡 🔎I'll guide you through the essential Steps for Problem Solving. 💥 Learn Decomposition a break down co...
So it is a step-by-step process. These steps are as follows: Analysing the problem. Developing an algorithm. Coding. Testing and debugging. The first step in the introduction to problem solving Computer Science Class 11 is analyzing the problem.
PROBLEM SOLVING TECHNIQUES Problem solving technique is a set of techniques that helps in providing logic for solving a problem. Problem solving can be expressed in the form of 1. Algorithms. 2. Flowcharts. 3. Pseudo codes. 4. Programs 1.ALGORITHM It is defined as a sequence of instructions that describe a method for solving a problem. In other ...
You will learn how to: Define a problem and its specifications 📝. Analyze a problem and identify its inputs, outputs and processing steps 🔎. Design an algorithm to solve a problem using various methods such as pseudocode, flowcharts and decision tables 📊. Implement an algorithm using a programming language such as Python 🐍.
Welcome to the channel where we try to make things easier for you! Syllabus PDF: https://cbseacademic.nic.in/web_material/CurriculumMain24/SrSec/Computer_Sci...
The several steps of this cycle are as follows : Step by step solution for a problem (Software Life Cycle) 1. Problem Definition/Specification: A computer program is basically a machine language solution to a real-life problem. Because programs are generally made to solve the pragmatic problems of the outside world.
in this video I have started chapter 5 Introduction to problem Solving of class 11 computer Science and in this part 1 video I have explained the following ...
This Post cum notes is specially covers Chapter 5 Getting started with Python of NCERT Computer Science Class 11 as per CBSE suggested syllabus. Introduction to Python. Python is a General Purpose high level Programming language used for developing application softwares. Contents [ hide] 1 Features of Python. 2 Important Programming Terminologies.
Welcome to the world of problem solving with Python! This first Orientation chapter will help you get started by guiding you through the process of installing Python on your computer. By the end of this chapter, you will be able to: Describe why Python is a useful computer language for problem solvers. Describe applications where Python is used.
Step-2: Write the python code and save the file with .py file extension. (Default directory is C:\Python33/Demo.py) Step-3: Open IDLE ( Python GUI) python shell Step-4: Click on file menu and select the open option Step-5: Select the existing python file Step-6: Now a window of python file will be opened
What is Problem solving? Problem solving is a process of transforming the description of a problem into the solution of that problem by using our knowledge of the problem domain and by relying on our ability to select and use appropriate problem-solving Strategies, Techniques and Tools. Problem solving (with in the context of
NCERT Class 11 Computer Science Chapter 4 | Class 11 Computer Science Notesclass 11 computer science one shot | class 11 computer science pythonHaan bhyii MA...
Disclaimer : I tried to give you the simple " Getting Started with Python Class 11 Notes " , but if you feel that there is/are mistakes in the code or explanation of " Getting Started with Python Class 11 Notes " given above, you can directly contact me at [email protected]. Reference for the notes is NCERT book.
Unlock This Free Class with Code "ASCOMP". In this class, Arpita Sharma will be teaching about the Python programming Language. It will be helpful for the aspirants preparing for CBSE Class 11. The class will be taught in Hinglish & the notes will be provided in English.
Features of Python. Python is a high-level language. It is a free and open-source language. It is an interpreted language, as Python programs are executed by an interpreter. Python programs are easy to understand as they have a clearly defined syntax and relatively simple structure. Python is case-sensitive.
Steps: Step 1: Open the text editor i.e. Notepad. Step 2: Write the python code and save the file with .py file extension. (Default directory is C:\Python33/Demo.py) Step 3: Open IDLE ( Python GUI) python shell. Step 4: Click on file menu and select the open option. Step 5: Select the existing python file.
Complete Chapter- Introduction to Problem Solving (In Hindi) | Class 11 Computer Science With PythonClass: 11thSubject: Computer ScienceChapter: Introduction...
Class 11 Geography Notes: Achieving success in CBSE exams requires a clear understanding of Geography concepts. Thus, Class 11 students must obtain well-structured Geography Class 11 Notes from experienced teachers. These notes are designed to help students understand the fundamental concepts of Geography and build a strong foundation for their future studies.
Chapter 5 Introduction to Problem Solving | Class 11 Computer Science |Python for Class 11 |in HindiConnect with Me: INSTAGRAM: @tbhvishalkumarhttps://www.in...