0% found this document useful (0 votes)
13 views3 pages

Class 11 If Else Python Programs

The document contains a list of Python programming exercises for 11th-grade students focusing on if-else conditions and choice-based programs. Each exercise presents a specific problem to solve, such as calculating squares and cubes, determining grades, calculating discounts, and converting temperatures. The exercises are designed to enhance programming skills through practical applications of conditional statements and user input handling.

Uploaded by

sapnayadav4832
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Class 11 If Else Python Programs

The document contains a list of Python programming exercises for 11th-grade students focusing on if-else conditions and choice-based programs. Each exercise presents a specific problem to solve, such as calculating squares and cubes, determining grades, calculating discounts, and converting temperatures. The exercises are designed to enhance programming skills through practical applications of conditional statements and user input handling.

Uploaded by

sapnayadav4832
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CLASS 11TH

PYTHON PROGRAMS
IF - ELSE CONDITION & CHOICE BASED PROGRAMS
1 write a program to input a number and display the cube and square of a positive number
If the number is negative then terminate the programs.
2 write a program to enter two unequal numbers. If the first number is greater than display
square of the smaller number and cube of the greater number otherwise vice versa.
if both numbers are equal then display message" both number are equal"
3 write a program to input 3 number and a character from user. If character is 'S' then print sum
of three numbers . If character is 'P' then print product of values. If input character is not
S' or 'P' then print invalid character and terminate the program. HINT: choice based program.
4 write a program to input a number between 1 to 7 and print it's corresponding weekday name.
for example 1 for Sunday 2 for Monday ………….7 for Saturday. If number is not between print
" invalid weekday number "
5 write a program to input cost price and the selling price of a product. If the selling price is more than
the cost price then calculate and display the acutal profit and profit percentage.

if the cost price is more than the selling price then calulate and display the actual loss and loss percentage
write a program to accept a number and check whether it is a one digit number or a two digit number. Now
6
perform the following
if it is a one digit number then display square of number (use exponent operator)
if it is a two digit number then display square root of number ( use math.sqrt())

7 input anumber and check it is odd number or even number


8 input length, width, height , radius from user and a character S/R/C
IF input character is 'S' then calculate area and perimeter of square
IF input character is 'P' then calculate area and perimeter of rectangle
IF input character is 'C' then calculate area and perimeter of circle
if any other character is input print "invalid choice"
9 input name, rollno, marks of three subjects. Claculate average of marks and set grade of student
as given below
AVERAGE OF MARKS GRADES
MORE THAN 80% BUT LESS THAN 100% DISTINCTION
MORE THAN 60% BUT LESS THAN 80% FIRST DIVISION
MORE THAN 45% BUT LESS THAN 60% SECOND DIVISION
MORE THAN 40% BUT LESS THAN 45% PASSED
LESS THEN 40% PROMOTION NOT GRANTED
10 input name of customer and amount of purchase. However the customer has to pay 12.5% as GST
on the price after the discount. Compute and display the net amount to be paid by the customer along with
the name.
ENTER '1' FOR AIR-CONDITIONER AND '2' FOR LCD TV for discount as given below
DISCOUNT ON AIR -
AMOUNT DISCOUNT ON LCD TV
CONDITIONER
UPTO RS. 20,000 5% 2.50%
RS. 20,001 - RS. 40,000 7.50% 5%
RS. 40,001 - RS. 60,000 10% 7.50%
MORE THAN RS. 60,000 12% 8.50%
11 a cloth showroom has announced festival discounts and the gifts on the purchase of items based
on total cost as given below. Calculate discount and print all values along with gift
TOTAL COST DISCOUNT ON AIR - GIFT
UPTO RS. 2000 5% CALCULATOR
RS. 2001 - RS. 5000 10% SCHOOL BAG
RS. 40,001 - RS. 60,000 15% WALL CLOCK
MORE THAN RS. 60,000 20% WRIST WATCH
12 a pre-paid taxi charges the passenger as per the following tarrif
distance rate
UPTO 5 km. rs. 100
for the next 5 km rs. 10/km
for the next 10 km rs 8/km
more than 25 km rs 5/km
write a program to input the distance covered and calculate the amount to be paid by passenger. Print the
values given below
taxi no. __________________ distance covered __________________ amount ________
distance covered __________________

given below the table calculate the amount of income tax on taxable income of a person who is up to the age of 60 yrs. If
13
the age Is more than 60 yrs than print wron category and terminate the programe.
taxable income income tax
upto rs. 2,50,000 0.00
more than 2,50,000 and 5,00,000 (TI - 1,60,000)*10%
more than 5,00,000 and 10,00,000 (TI - 5,00,000)*20% + 34,000
more than 10,00,000 (TI - 10,00,000)*30% + 94,000
write a program to input taxableincome and calculate income tax and print all values.
14 the volume of cuboid , cylinder and cone can be calculated by the formula
choice formula
'CU' for colume of cuboid v=l*b*h
2
'CY' for volume of cylinder v= π * r *h
2
'CO' for volume of cone v=1/3 * π * r * h
write a program to calculate and display volume of different solids with appropriate input .

15 a person want to deposit a certain sum of amount under TERM DEPOSIT scheme in a bank. Write a program to
RATE OF INTEREST FOR AGE LESS RATE OF INTEREST FOR AGE
No. OF DAYS
THAN 60 YRS ABOVE 60 YRS
UPTO 180 DAYS 5.5% 0.5% EXTRA
181 TO 364 DAYS 7.5% 0.5% EXTRA
EXACT 365 DAYS 9.0% 0.5% EXTRA
MORE THAN 365 DAYS 9.5% 0.5% EXTRA
write a program to calculate maturity amount and display values as
name of person ________ age ________
deposit amount ________ time ________ days interest ________
maturity amount ________
16 write a program to calculate gross salary of an employee
house rent allowance
input basic salary as (bs) dearness allowance (da) medical allowance (ma) special allowance (sa)
(hra)
upto rs. 10,000 10% of basic salary 5% of basic salary rs. 500 2% of basic salary
rs. 10,001 to 20,000 15% of basic salary 7.5% of basic salary rs. 750 2.5% of basic salary
rs. 20,001 to 30,000 20% of basic salary 10% of basic salary rs. 1000 5% of basic salary
rs. 30,001 an above 25% of basic salary 12.5% of basic salary rs. 1250 10% of basic salary
calculate pf 12.5% of basic salary
gross salary = bs+da+hra+ma+sa
display the values on screen in following format
PF
NAME EMP CODE BASIC DA HRA MEDICAL SPL ALLOW GROSS SALARY
DEDUCTED
XXX XXX XXX XXX XXX XXX XXX XXX XXX

write a program to calculate TEMPRATURE from farenhite to celcius and celcius to farenhite as per the choice
17 input by user. If choice is 'C' convert temprature from farenhite to celcius if choice is 'F' convert temprature
celcius to farenhite and display the output wit proper message.
C=5/9*(f-32) F=1.8*C+32
write a program to input sum, rate , time and type of interest ('S' for simple interest or 'CI' for compound
18
interest ) . Calculate and display the result with proper message

SI= (P * R* T)/100 CI=P*((1+R/100)T-1)


19 create a menu as given below . INPUT 2 VALUES AND SYMBOL FROM GIVEN CHOICE.
MENU
ENTER + SYMBOL FOR ADDITION:
ENTER - SYMBOL FOR CALCULATOR:
ENTER * SYMBOL FOR MULTIPLICATION:
ENTER / SYMBOL FOR DIVISION:
ENTER ** SYMBOL FOR EXPONENT:

display the output as per the character given by the user

You might also like