Current Affairs updated daily
KalviGavaniKalviGavani
Class 11 · Tamil Nadu State Board

Problem Solving & Python Programming Solutions | KalviGavani

TN Class 11 CS Problem Solving and Python Programming exercise solutions — algorithms, flowcharts, pseudocode, and Python basics with code examples.

Updated 15 June 202614 min read

Problem Solving and Python Programming — TN Class 11 CS Exercise Solutions

Complete exercise solutions for the Tamil Nadu Board Class 11 Computer Science chapter Problem Solving and Python Programming. Covers algorithms, flowcharts, pseudocode, and Python basics with code examples.


How to Use This Page

1. Attempt each exercise on your own first — write algorithms and draw flowcharts before checking answers. 2. Trace algorithms step by step — use sample inputs and manually follow each step. 3. Practice drawing flowcharts — use correct symbols (oval, parallelogram, rectangle, diamond). 4. Type and run Python code — verify your programs in IDLE or any Python editor. 5. Note your errors — maintain a mistake notebook for revision before the exam.


Key Concepts (Quick Recap)

ConceptDetails
Problem Solving Steps1. Understand the problem 2. Develop an algorithm 3. Write the program 4. Test and debug
AlgorithmA finite, step-by-step procedure to solve a problem with clear input, output, and unambiguous steps
PseudocodeAn informal, human-readable description of an algorithm using English-like statements
FlowchartA diagrammatic representation using standard symbols to show the flow of an algorithm
Flowchart SymbolsOval = Start/End, Parallelogram = Input/Output, Rectangle = Process, Diamond = Decision
Top-Down DesignBreaking a complex problem into smaller sub-problems (modular approach)
PythonHigh-level, interpreted, dynamically typed, platform-independent programming language
Python FeaturesSimple syntax, interpreted execution, dynamic typing, open-source, rich libraries
Python IDEsIDLE (default), Jupyter Notebook, PyCharm, VS Code
Python modesInteractive mode (>>> prompt, line-by-line) and Script mode (save and run .py files)

Python Basics — Code Examples:

# Printing output
print("Hello, World!")          # Output: Hello, World!
print("Sum =", 5 + 3)           # Output: Sum = 8

# Variables
name = "Student"
age = 16
height = 5.6

# Input from user
x = int(input("Enter a number: "))   # Reads integer input
s = input("Enter your name: ")        # Reads string input

# Multiple output
print("Name:", name, "Age:", age)
# Simple arithmetic
a = 10
b = 3
print(a + b)    # 13 (addition)
print(a - b)    # 7  (subtraction)
print(a * b)    # 30 (multiplication)
print(a / b)    # 3.333... (true division)
print(a // b)   # 3  (floor division)
print(a % b)    # 1  (modulo)
print(a ** b)   # 1000 (exponentiation)

I. Choose the Best Answer (MCQs)

Q1. Which symbol is used for a decision in a flowchart? (a) Rectangle (b) Parallelogram (c) Diamond (d) Oval

Answer(c) Diamond

The diamond symbol represents a decision point in a flowchart where the flow can branch based on a condition (Yes/No or True/False).


Q2. An algorithm must have: (a) Infinite steps (b) Ambiguous steps (c) Finite number of steps (d) No output

Answer(c) Finite number of steps

An algorithm must terminate after a finite number of steps. Infinite loops or never-ending procedures are not valid algorithms.


Q3. Python is a: (a) Low-level language (b) High-level language (c) Machine language (d) Assembly language

Answer(b) High-level language

Python is a high-level programming language — its syntax is close to human language, it handles memory management automatically, and it is platform-independent.


Q4. The input() function in Python returns a value of type: (a) int (b) float (c) str (d) bool

Answer(c) str

The input() function always returns a string. To get a number, you must convert it explicitly using int() or float().


Q5. Which flowchart symbol is used for input/output operations? (a) Rectangle (b) Diamond (c) Parallelogram (d) Circle

Answer(c) Parallelogram

The parallelogram represents input (reading data) and output (displaying results) operations in a flowchart.


Q6. Top-down design means: (a) Solving from bottom to top (b) Breaking a problem into smaller sub-problems (c) Writing code without planning (d) Testing before coding

Answer(b) Breaking a problem into smaller sub-problems

Top-down design is a problem-solving approach where a complex problem is broken down into smaller, more manageable sub-problems, which are solved individually.


Q7. The default IDE that comes with Python is: (a) PyCharm (b) VS Code (c) IDLE (d) Jupyter

Answer(c) IDLE

IDLE (Integrated Development and Learning Environment) is the default IDE that comes bundled with Python installation.


II. Fill in the Blanks

1. An algorithm is a step-by-step procedure to solve a problem. 2. The diamond symbol is used to represent a decision in a flowchart. 3. The oval symbol represents the start and end of a flowchart. 4. Python was created by Guido van Rossum. 5. In Python, the print() function is used to display output on the screen. 6. The input() function always returns a value of type string (str). 7. To convert a string input to an integer, we use the int() function. 8. A flowchart is a diagrammatic representation of an algorithm. 9. The process of finding and fixing errors in a program is called debugging. 10. Python executes code line by line in interactive mode. 11. The parallelogram symbol in a flowchart represents input/output operations. 12. A pseudocode is an informal description of an algorithm using English-like statements. 13. To run a Python program saved as a file, we use script mode. 14. The type() function in Python returns the data type of a variable.


III. True or False (with corrections for false statements)

Q1. An algorithm can have infinite steps.
Answer

False. An algorithm must have a finite number of steps. It must terminate after a limited number of operations.


Q2. Python is a compiled language.
Answer

False. Python is an interpreted language. The Python interpreter executes code line by line, converting it to machine code at runtime, not before execution.


Q3. A flowchart uses standard symbols to represent different operations.
Answer

True. Flowcharts use standardised symbols: oval (start/end), parallelogram (input/output), rectangle (process), diamond (decision), and arrows (flow direction).


Q4. The input() function returns an integer by default.
Answer

False. The input() function always returns a string. You must use int() or float() to convert it to a number.


Q5. Pseudocode follows strict syntax rules like a programming language.
Answer

False. Pseudocode uses informal, English-like statements and does NOT follow strict programming syntax. It is meant to be human-readable and flexible.


Q6. Python is a platform-independent language.
Answer

True. Python code can run on Windows, macOS, Linux, and other platforms without modification, making it platform-independent.


Q7. The rectangle symbol in a flowchart represents input/output.
Answer

False. The rectangle symbol represents a process (computation or calculation). The parallelogram represents input/output.


IV. Match the Following

Column AColumn B
1. Oval(e) Start/End
2. Parallelogram(a) Input/Output
3. Rectangle(d) Process
4. Diamond(b) Decision
5. Arrow(c) Flow direction
6. Circle(f) Connector
Answer1–e, 2–a, 3–d, 4–b, 5–c, 6–f

Column AColumn B
1. print()(c) Display output
2. input()(a) Read user input
3. int()(d) Convert to integer
4. type()(b) Check data type
5. IDLE(e) Python's default IDE
6. .py(f) Python file extension
Answer1–c, 2–a, 3–d, 4–b, 5–e, 6–f

V. Answer Briefly (2-Mark Questions)

Q1. What is an algorithm? Write an algorithm to find the sum of two numbers.
Answer

An algorithm is a finite, step-by-step procedure to solve a problem. It must have:

  • A finite number of steps
  • Clear and unambiguous instructions
  • Defined input and output

Algorithm to find the sum of two numbers:

Step 1: Start Step 2: Read two numbers A and B Step 3: Calculate Sum = A + B Step 4: Display Sum Step 5: Stop

Q2. What is a flowchart? Draw a flowchart to find the area of a rectangle.
Answer

A flowchart is a diagrammatic representation of an algorithm that uses standard geometric symbols to show the flow of operations.

Flowchart for area of a rectangle:

[ Start ] | v [ Read Length, Breadth ] | v [ Area = Length × Breadth ] | v [ Display Area ] | v [ Stop ]

Python code:

length = float(input("Enter length: "))
breadth = float(input("Enter breadth: "))
area = length * breadth
print("Area of rectangle =", area)

Q3. Differentiate between interactive mode and script mode in Python.
Answer
FeatureInteractive ModeScript Mode
ExecutionLine by line, immediate outputEntire file executed at once
PromptShows >>> promptNo prompt
SavingNot saved permanentlySaved as .py file
UseQuick testing, calculationsFull programs, projects
EditingCannot edit previous linesCan edit and re-run

Q4. Write the features of Python.
Answer

1. Simple and easy to learn — close to English, minimal syntax 2. Interpreted — executes line by line, no compilation needed 3. Platform-independent — runs on Windows, macOS, Linux 4. Dynamically typed — no need to declare variable types 5. Open-source — free to use and distribute 6. Rich library support — extensive standard library 7. Object-oriented — supports OOP concepts 8. High-level — handles memory management automatically


VI. Answer in Detail (5-Mark Questions)

Q1. Explain the problem-solving process with an example. Write an algorithm and flowchart to find whether a number is even or odd.
Answer

Problem-Solving Process:

1. Understand the Problem: Read the problem carefully. Identify what is given (input) and what is required (output). 2. Develop an Algorithm: Write a step-by-step procedure to solve the problem. 3. Write the Program (Coding): Translate the algorithm into a programming language. 4. Test and Debug: Run the program with different inputs, check for errors, and fix them.

Algorithm to check if a number is even or odd:

Step 1: Start Step 2: Read the number N Step 3: If N % 2 == 0, then Step 4: Display "N is even" Step 5: Else Step 6: Display "N is odd" Step 7: Stop

Flowchart:

[ Start ] | v [ Read N ] | v < N % 2 == 0? > / \ Yes No | | v v [ Print "Even" ] [ Print "Odd" ] \ / \ / v v [ Stop ]

Python Program:

# Program to check if a number is even or odd
N = int(input("Enter a number: "))
if N % 2 == 0:
    print(N, "is even")
else:
    print(N, "is odd")

Output:

Enter a number: 7 7 is odd Enter a number: 12 12 is even

Q2. Explain the different flowchart symbols with their purpose. Draw a flowchart to find the largest of three numbers.
Answer

Flowchart Symbols:

SymbolShapePurposeExample
TerminalOvalStart or end of the algorithmSTART, STOP
Input/OutputParallelogramReading input or displaying outputRead A, Print Result
ProcessRectangleComputation or calculationSum = A + B
DecisionDiamondConditional check with Yes/No branchesIs A > B?
FlowlineArrowDirection of flowConnects symbols
ConnectorCircleConnects parts of flowchart on different pagesA, B, C

Algorithm to find the largest of three numbers:

Step 1: Start Step 2: Read three numbers A, B, C Step 3: If A > B and A > C, then Step 4: Largest = A Step 5: Else if B > C, then Step 6: Largest = B Step 7: Else Step 8: Largest = C Step 9: Display Largest Step 10: Stop

Python Program:

# Program to find the largest of three numbers
A = int(input("Enter first number: "))
B = int(input("Enter second number: "))
C = int(input("Enter third number: "))

if A > B and A > C:
    largest = A
elif B > C:
    largest = B
else:
    largest = C

print("The largest number is", largest)

Output:

Enter first number: 25 Enter second number: 47 Enter third number: 18 The largest number is 47

Q3. Explain the features of Python with examples. Write a Python program to calculate the simple interest.
Answer

Features of Python:

1. Simple and Readable Syntax: Python code reads almost like English, making it easy to learn and write.

# Simple and readable
print("Hello, World!")

2. Interpreted Language: Python executes code line by line. There is no separate compilation step. Errors are reported immediately during execution.

3. Dynamically Typed: You do not need to declare variable types. Python determines the type automatically.

x = 10        # x is an integer
x = "hello"   # x is now a string — type changes dynamically

4. Platform-Independent: Python programs run on any operating system (Windows, macOS, Linux) without modification.

5. Rich Standard Library: Python comes with a large collection of built-in modules for mathematics, file handling, networking, and more.

import math
print(math.sqrt(25))   # Output: 5.0

6. Object-Oriented: Python supports OOP concepts like classes, objects, inheritance, and polymorphism.

7. Open Source: Python is free to download, use, and distribute. Its source code is publicly available.

8. Extensible and Embeddable: Python can be extended with C/C++ modules and can be embedded within other applications.

Python Program to Calculate Simple Interest:

# Program to calculate simple interest
# Formula: SI = (P × N × R) / 100

P = float(input("Enter principal amount: "))
N = float(input("Enter number of years: "))
R = float(input("Enter rate of interest: "))

SI = (P * N * R) / 100

print("Principal Amount  : Rs.", P)
print("Number of Years   :", N)
print("Rate of Interest  :", R, "%")
print("Simple Interest   : Rs.", SI)
print("Total Amount      : Rs.", P + SI)

Output:

Enter principal amount: 10000 Enter number of years: 5 Enter rate of interest: 8.5 Principal Amount : Rs. 10000.0 Number of Years : 5.0 Rate of Interest : 8.5 % Simple Interest : Rs. 4250.0 Total Amount : Rs. 14250.0

Common Mistakes to Avoid

1. Forgetting to convert input() to a number — input() always returns a string. Use int() or float() for numeric calculations.

2. Confusing flowchart symbols — Oval = Start/End (not process), Rectangle = Process (not I/O), Parallelogram = I/O (not decision), Diamond = Decision (not process).

3. Writing infinite algorithms — Every algorithm must have a clear stopping condition. If-else branches must always lead toward termination.

4. Missing the Start/Stop in flowcharts — Every flowchart must begin with Start (oval) and end with Stop (oval).

5. Not using proper flow direction in flowcharts — Arrows must clearly show the direction of flow. Decision boxes must have two outgoing arrows (Yes and No).

6. Mixing up algorithm and program — An algorithm is written in plain English steps; a program is written in a programming language like Python.

7. Confusing interactive and script mode — Interactive mode is for quick testing (shows >>> prompt); script mode is for saving and running full programs.


Exam Checklist

Before your exam, make sure you can:

  • [ ] Define an algorithm and list its properties (finite, unambiguous, input, output)
  • [ ] Write algorithms for common problems (sum, even/odd, largest of three)
  • [ ] Draw correct flowcharts using proper symbols
  • [ ] Identify and explain all flowchart symbols (oval, parallelogram, rectangle, diamond, arrow, circle)
  • [ ] Explain the four steps of problem solving
  • [ ] Differentiate between interactive and script mode in Python
  • [ ] List and explain the features of Python
  • [ ] Write basic Python programs (input, print, arithmetic)
  • [ ] Use input(), int(), float(), and print() correctly
  • [ ] Differentiate between algorithm, pseudocode, and flowchart

Frequently Asked Questions

The four steps are: 1) Understand the problem, 2) Develop an algorithm, 3) Write the program (coding), 4) Test and debug. These follow the analysis-design-coding-testing cycle.
← Browse all Class 11 Exercise Solutions

More exercise solutions