Programs · Program 5-3
Q.Program 5-3: Write a Python program to find the area of a rectangle given that its length is 10 units and breadth is 20 units.
Rajasthan RbseTextbookSubjective· 2mImportance★★★★★est
12% · 6/49 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →Assign the given length and breadth to variables, compute length * breadth, and print the result — 10 × 20 = 200 square units.
The idea. This is the simplest input–process–output pattern: the data is fixed by the question (length = 10, breadth = 20), the process is the well-known formula area = length × breadth, and the output is one print(). Using variables (instead of writing print(10*20)) makes the program self-documenting and easy to change later.
Program
# prog5-3.py
# Program to find the area of a rectangle
length = 10
breadth = 20
area = length * breadth
print("Area of the rectangle is", area, "square units")
Expected output
Area of the rectangle is 200 square units
Key lines
length = 10andbreadth = 20store the given dimensions as integers.area = length * breadthevaluates 10 × 20 = 200 and stores it inarea. Since both operands areint, the result is theint200. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.