Question 1 Operators Time Calculation

Sum Two Time Durations (Hours, Minutes, Seconds)

Write a Python program to read two time intervals in hours, minutes, and seconds, calculate their sum, and properly convert excess seconds into minutes and excess minutes into hours.

Solution Code Screenshot Click image to zoom
2 Hour Min Sec Sum Solution
Question 2 Operators Time Calculation

Sum Two Time Intervals in Hours and Minutes

Write a Python program to input two time intervals in hours and minutes, compute their total sum, and convert every 60 minutes into an additional hour.

Solution Code Screenshot Click image to zoom
2 Hour Min Sum Solution
Question 3 Operators Arithmetic

Consecutive Three-Digit Number Generator

Write a Python script that asks the user for a digit between 0 and 7. The program should use arithmetic expressions to construct a 3-digit number.(e.g., input 3 gives 345).

Solution Code Screenshot Click image to zoom
3 Digit Number Sum Solution
Question 4 Operators Floor Division Modulus

Sum of Digits and Number Reversal for a 4-Digit Integer

Write a Python program that prompts the user to enter a positive four-digit integer. The program must isolate each individual digit using arithmetic operators (floor division // and modulus %) and perform two tasks:

Solution Code Screenshot Click image to zoom
4 Digit Sum Solution
Question 5 Operators Geometry

Calculate the Area of a Circle

Write a Python program to input the radius of a circle and calculate the area of the circle using the formula = π * r².

Solution Code Screenshot Click image to zoom
Area of Circle Solution
Question 6 Operators Basic Math

Perform All Basic Arithmetic Operations

Write a Python program to read two numbers and perform addition (+), subtraction (-), multiplication (*), float division (/), floor division (//), modulus (%), and exponentiation (**).

Solution Code Screenshot Click image to zoom
Arithmetic Operations Solution
Question 7 Operators Assignment

Demonstrate Compound Assignment Operators

Write a Python program to demonstrate shorthand assignment operators (+=, -=, *=, /=, %=, //=, **=) on numerical variables.

Solution Code Screenshot Click image to zoom
Assignment Operators Solution
Question 8 Operators Mensuration

Calculate Volume and Total Surface Area of a Cube

Write a Python program to read the edge length of a cube and calculate its Volume and Total Surface Area.

Solution Code Screenshot Click image to zoom
Cube Volume & TSA Solution
Question 9 Operators Conversion

Convert Total Days into Weeks and Remaining Days

Write a Python program to take a total number of days as user input and convert it into weeks and remaining days using floor division and modulus.

Solution Code Screenshot Click image to zoom
Day to Week Solution
Question 10 Operators Finance

Calculate Employee Gross Salary

Write a Python program to input the basic salary of an employee, calculate allowances (such as DA, HRA, TA), and compute the total gross salary.

Solution Code Screenshot Click image to zoom
Employee Gross Salary Solution
Question 11 Operators Arithmetic

Calculate Sum of Multiple Integers Without Using Of Sum Operator

Write a Python program to take multiple integer inputs from the user and display their total sum.

Solution Code Screenshot Click image to zoom
Integer Sum Solution
Question 12 Operators Temperature Converter

Fahrenheit to Celsius Temperature Converter

Write a Python program that accepts a temperature value in Fahrenheit as a floating-point number from the user. Convert the temperature to Celsius using the standard conversion formula and display the result.

Solution Code Screenshot Click image to zoom
Lab Program Solution
Question 13 Operators Conversion

Convert Seconds into Minutes and Remaining Seconds

Write a Python program that prompts the user to enter a total number of seconds as an integer. Using the floor division (//) and modulus (%) operators, convert the total seconds into complete minutes and remaining seconds, and display both values.

Solution Code Screenshot Click image to zoom
Minute Convert Solution
Question 14 Operators Precedence

Operator Precedence, Associativity, and Boolean Expressions in Python

Write a Python program to demonstrate the order of operations (PEMDAS/BODMAS), left-to-right associativity for arithmetic operators, type casting functions (int(), float()), relational comparisons, and logical short-circuiting operators (and, or, not).

Solution Code Screenshot Click image to zoom
Operator Precedence Solution
Question 15 Operators Overview

Evaluation of Relational, Arithmetic, and Logical Expressions in Python

Write a Python script highlighting comparison, logical (and, or, not), identity (is, is not), and membership (in, not in) operators.

Solution Code Screenshot Click image to zoom
All Operators Solution
Question 16 Operators Math & Roots

Calculate the Square Root of a Number

Write a Python program to compute the square root of a given number using the exponentiation operator (** 0.5) without importing the math module.

Solution Code Screenshot Click image to zoom
Root Calculation Solution
Question 17 Operators Financial Math

Calculate Simple Interest and Total Amount

Write a Python program to take Principal, Rate of interest, and Time period as inputs, then compute Simple Interest (SI = P*R*T/100) and the total final amount.

Solution Code Screenshot Click image to zoom
Simple Interest Solution
Question 18 Operators Input & Formats

Student Report Card — Total Marks Calculation

Write a Python program that accepts a student's basic credentials (name, class, and roll number) along with their marks in five subjects. Calculate and display the student's details along with the total sum of their marks.

Solution Code Screenshot Click image to zoom
Student Details Solution
Question 19 Operators Percentage

Calculate Total Marks and Percentage

Write a Python program to input marks of 5 different subjects, calculate the total marks scored, and calculate the overall percentage.

Solution Code Screenshot Click image to zoom
Subject Percentage Solution
Question 20 Operators Swapping

Swap Two Numbers Without Using a Temporary Variable

Write a Python program that accepts two numbers from the user and swaps their values without introducing a third (temporary) variable. Implement the swap using arithmetic operations (addition and subtraction) and display the values of both variables before and after swapping.

Solution Code Screenshot Click image to zoom
Basic Swap Solution
Question 21 Operators Number Swapping

Swap First and Last Digits of a Two-Digit Number

Write a Python program to read an integer and swap its first digit with its last digit using arithmetic operations.

Solution Code Screenshot Click image to zoom
Swap First and Last Digits Solution
Question 22 Operators Swap Numbers

Swap Two Numbers (Standard Method)

Write a Python program that prompts the user to enter two numbers and swaps their values using Python's simultaneous tuple assignment idiom (a, b = b, a). Display the swapped values of both variables.

Solution Code Screenshot Click image to zoom
Swap Number Solution
Question 23 Operators Temp Variable

Swap Two Numbers Using a Temporary Variable

Write a Python program to swap the values of two variables using a third temporary helper variable.

Solution Code Screenshot Click image to zoom
Swap with Temp Variable Solution
Question 24 Operators Multiple Assignment

Rotate Swap Three Numbers via Multiple Assignment

Write a Python program to cycle and swap three numbers (1st = 2nd, 2nd = 3rd, 3rd = 1st) using Python's simultaneous multiple assignment tuple-packing syntax.

Solution Code Screenshot Click image to zoom
Swap Three Num Multiple Assignment Solution
Question 25 Operators Tuple Packing

Swap Two Numbers Using Multiple Assignment (a, b = b, a)

Write a Python program to swap two variables in a single line of code using Python's multiple assignment idiom (a, b = b, a).

Solution Code Screenshot Click image to zoom
Swap Using Multiple Assignment Solution
Question 26 Operators No Temp

Update Three Variables with Pairwise Consecutive Sums Using Multiple Assignment

Write a Python program that accepts three numbers from the user into variables a, b, and c. Using Python's simultaneous multiple assignment feature, update the variables such that:

Solution Code Screenshot Click image to zoom
Swap Without Temp Solution
Question copied to clipboard!