Ai Practical File
Ai Practical File
FILE
NAME: KHUSHI GOEL
GRADE: 10 C
ROLL NO: 22
Q1. Write a python algorithm to find the larger of the two numbers.
CODE:
OUTPUT:
Q2. Write a Python program that takes three numbers as input from the user
and finds their average.
CODE:
OUTPUT:
Q3. Write a program to take a number from the user and check whether it is a
prime number or not.
CODE:
OUTPUT:
Q4. Write a program to input two numbers and find their HCF and LCM.
CODE:
OUTPUT:
Q5. Write a program to print the sum of the first 10 natural numbers.
CODE:
OUTPUT:
Q6. Create a list of all the students in your class and sort them in alphabetical
order.
CODE:
OUTPUT:
Q7. Write a program to find the numbers that are divisible by 7 and multiples
of 5 between 1200 and 2200.
CODE:
OUTPUT:
Q8. Write a program to calculate the area and perimeter of a rectangle.
CODE:
OUTPUT:
Q9. Write a program to calculate the average marks of three subjects.
CODE:
OUTPUT:
Q10. Write a program to add the elements of the two lists.
CODE:
OUTPUT:
Q11. Write a python program to display all the elements of the ordered
list[3,6,9,10,11,14,15,22,25]
CODE:
OUTPUT:
Q12. Write a program to input the name, age, and basic salary of an employee.
Calculate the total salary of an employee by adding 10%DA and 10%HRA to the
basic salary.
CODE:
OUTPUT:
Q13. Create a program in python to determine whether a year is a leap year or
not. A year is leap year if it is divisible by 4.
CODE:
OUTPUT:
Q14. Write a program to display “Valid Voter” if the following condition is true:
Age of the person should be >=18
CODE:
OUTPUT:
OUTPUT: