CLASS XI- Python Programming
CLASS XI- Python Programming
INDEX
WORKSHEET 1: SIMPLE PROGRAMS
1. WAP to assign your name and class to the variables name and grade respectively.
Display the result in the given format
2. WAP to assign the value 10 to the variable price, double the value of the variable
price , decrease the value by 5 and print it.
10. WAP to accept the length in inches and convert it to centimeters. (one inch =
2.54 cm)
11. WAP to input the radius and calculate area and volume of a sphere.
12. Assume 1 cubic foot = 7.481 gallons. WAP to ask the user to enter the number
of gallons and display it in cubic feet.
13. Input basic salary. Calculate allowance as 12% of basic salary and deduction
as 10% of basic salary. Calculate net salary by using the formula net salary=basic
+allowance – deduction
14. Input amount in paise. Convert to equivalent Rupees and paise.
17. WAP to accept a 2 digit number and display the sum of its digits. (e.g. for 57
the display should be 12)
18. WAP to accept temperature in celsius and convert it to fahrenheit.
19. WAP to input 3 numbers and swap them as 1st number becomes 2nd, 2nd the
3rd and 3rd as the 1st.
WORKSHEET 2: IF/IF-ELSE/IF-ELIF
2. Write a program to accept the 2 sides of a rectangle and display if its area
is greater than its perimeter.
3. Write a program to print the largest of three numbers.
4. Write a program to accept the sales amount and display the net amount
according to the following discount table.
5. Write a program to accept two numbers and an operator and display the
answer according to the specified operator (+, - , *, /, %).
6. Write a program to accept the day number from the user and display the
entrance fee for a theme park. Accept the number of tickets and display the
total amount to be paid.
MAIN MENU-------------------------------------------------
Area of a Triangle
Area of a Square
Area of a Circle
Exit
11. WAP to print whether a given input is an uppercase, or a lowercase
character or a digit or any other character.
12. Write a program to get date in three variables dd, mm, yy to accept the
date, month and the year in the century format. Write code to check the
validity of the date.
13. Accept three numbers. Find the sum and the sum of non duplicate
numbers(Eg: sum of 3, 3, 6=12; Sum of Non duplicate numbers of 3, 3, 6=6)
14. Write the code to find the largest and second largest from accepted three
numbers.
15. Accept the country name(India or UAE).Accept a day also. Display Holiday
Sunday and Saturday for India & Friday and Saturday for UAE.
WORKSHEET 3: Flow of control
2. WAP to print all odd and even numbers between 1 and n. Accept n from
user
3. WAP to print the even numbers in reverse between 100 and n.
4. WAP to print the sum of 1st N natural numbers. Accept N from user
5. WAP to accept any 10 numbers and display their sum.
10. Accept n1 and n2 from the user. Write a menu driven program to do the following
operations :
13. WAP to find the smallest and the second smallest numbers inputted.