Class-X: Artificial Intelligence(417)
Half Yearly Examination : 2025-26
Practice Worksheet for Python Practical
1. Write a program to input two numbers and print their sum, difference, product, and quotient.
2. Write a program to calculate the area and perimeter of a rectangle.
3. Write a program to find the largest of three numbers.
4. Write a program to check whether a given number is even or odd.
5. Write a program to swap two numbers without using a third variable.
6. A shopkeeper gives a 10% discount if the purchase amount is greater than ₹1000. Write a
program to calculate the final amount.
7. Write a program to check whether a given year is a leap year or not.
8. Write a program to accept marks of a student and print the grade according to the following:
• 90 –100 → A
• 80 – 89 → B
• 70–79 → C
• 60 - 69→ D
• 50 - 59→E
• Below 50→ Fail
9. Write a program to print the multiplication table of a given number.
10. Write a program to print the sum of the first 10 natural numbers.
11. Write a program to print the following pattern:
*
**
***
****
12. Write a program to check whether a string is a palindrome or not.
13. Write a program to create a list of 5 numbers and display it.
➢ Print the first and last elements of a list.
➢ Change the second element of a list to a new value.
➢ Add a new element at the end and insert one at a specific position.
➢ Remove an element using remove() and pop() methods.
14. Calculate the sum of all elements in a list using a loop.
15. Write a program to find the largest and smallest number in a list.
16. Reverse the list using reverse ( ) method.
17. Sort a list in ascending and descending order.
18. Create a tuple with mixed data types (e.g., integer, string, float).
19. Write a program to access the third element of a tuple.
20. Check if a specific value exists in a tuple.
21. Write a program in python to concatenate two lists using Extend () and Append () function.