0% found this document useful (0 votes)
46 views4 pages

Practical File Class X - Holiday Homework

The document contains 20 programming problems covering topics like basic input/output, arithmetic operations, conditional statements, lists and dictionaries. For each problem, coding is provided to write a Python program to solve the given task.

Uploaded by

baruah.jigisha16
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)
46 views4 pages

Practical File Class X - Holiday Homework

The document contains 20 programming problems covering topics like basic input/output, arithmetic operations, conditional statements, lists and dictionaries. For each problem, coding is provided to write a Python program to solve the given task.

Uploaded by

baruah.jigisha16
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/ 4

Artificial Intelligence

Class: X
Practical File (2024-25)

1. Write a program to display three statements using print().


2. Write a program to display the sum and difference of two numbers.
3. Write a program to display its area and perimeter of a square.
4. Write a program to display the area and perimeter of a rectangle.
5. Write a program to calculate and display the perimeter of a triangle.
6. Write a program to accept three numbers and print their sum and product
7. Write a program to accept a number from the user and display its square and cube.
8. Write a program to accept the radius of a circle and display its area and circumference.
9. Write a program to accept the distance and time taken and display the speed.
10. Write a program to accept principal amount, rate of interest and time. Calculate and display the
simple interest and amount.
11. Write a program to accept marks in five subjects and display the average marks and percentage.
12. Write a program to find the sale price of an item with given price and discount.
13. Write a program to accept the name and age of a user and display whether he is able to vote or not.
14. Write a program to accept the cost price and selling price of a product and display its profit or loss.
15. Write a program to display whether the number entered by the user is positive or negative.
16. Write a program in python to display the grade of a user by accepting name and percentage from
the user the great criteria is as follows
Percentage Grade
>=90 Excellent
>=80 Very good
>=60 Good
>=33 Satisfactory
<33 Needs
improvement
17. Write a program in python to create a list of five subjects and display it.
18. Write a program in python to create a dictionary of seven states and their capital. (Use states as
keys and capitals as values)
19. Write a program in python to create a list of five subjects.
Write the code to:
a. Display the list.
b. Add a subject humanities at the 4th place.
c. Display the first four subject.
d. Display the 2nd and 4th subject.
20. Write a program in python to create a dictionary of five states and their capitals. Use states (UP,
Odisha, Maharastra, Tamil Nadu, Delhi)
Write the code to:
a. Display the dictionary.
b. Add a state ‘Bihar’ in the dictionary and display the dictionary.
c. To update the value of state ‘Maharastra’ as ‘Mumbai’ and display the dictionary.
Coding :
1. print("Hello")
print("Welcome to the world of Programming")
print("Learn with Python")
2. a=20
b=45
print('Sum of two numbers is: ' , a+b)
print('Difference of two numbers is: ' , a-b)
3. side=int(input('Enter the length of the side of square'))
Area= side*side
Per= 4*side
print('Area of the square is: ',Area)
print('Perimeter of the square is: ',Per)
4. l=int(input('Enter the length of rectangle'))
b=int(input('Enter the breadth of rectangle'))
Area= l*b
Per= 4*(l+b)
print('Area of the rectangle is: ',Area)
print('Perimeter of the rectangle is: ',Per)
5. s1=int(input('Enter the first side of the triangle'))
s2=int(input('Enter the second side of the triangle'))
s3=int(input('Enter the third side of the triangle'))
Per= s1+s2+s3
print('Perimeter of the triangle is: ',Per)
6. n1=int(input('Enter the first number'))
n2=int(input('Enter the second number'))
n3=int(input('Enter the third number'))
sm=n1+n2+n3
print('sum of three numbers is: ',sm)
print('Product of three numbers is: ',n1*n2*n3)
7. num=int(input('Enter the number'))
sq= num*num
cube= num*num*num
print('Square of the number is: ',sq)
print('Cube of the number is: ',cube)
8. r=int(input('Enter the radius of the circle'))
Area= 3.14 * r * r
Cir= 2 * 3.14 * r
print('Area of the circle is: ',Area)
print('Circumference of the circle is: ',Cir)
9. d=int(input('Enter the distance travelled in km'))
t=int(input('Enter the time taken in hours'))
speed= d/t
print('Speed is: ',speed, 'km/hr')
10. p=int(input('Enter the principal amount'))
r=int(input('Enter the rate of interest'))
t=int(input('Enter the time period'))
interest = p*t*r/100
amt=p+interest
print('Total Interest is: ',interest)
print('Total amount is: ',amt)
11. eng=int(input('Enter the marks obtained in English'))
maths=int(input('Enter the marks obtained in Maths'))
sci=int(input('Enter the marks obtained in Science'))
hin=int(input('Enter the marks obtained in Hindi'))
ai=int(input('Enter the marks obtained in Artificial Intelligence'))
total= eng+maths+sci+hin+ai
avg=total/5
per=total*100/250
print('The average marks scored are: ',avg)
print('The percentage is: ',per)
12. mrp=int(input('Enter the marked price of the item'))
disp=int(input('Enter the discount offered in percentage'))
dis=disp*mrp/100
sp= mrp - dis
print('The Marked Price is: ',mrp)
print('The discount is: ',disp, '%')
print('The Selling Price is: ', sp)
13. age=int(input('Enter the age'))
if age>=18:
print('You are able to vote')
else:
print('You are not able to vote')
14. sp=int(input('Enter the Selling Price of the product'))
cp=int(input('Enter the Cost Price of the product'))
if sp > cp:
profit = sp-cp
print('The profit is: ', profit)
else:
loss = cp-sp
print('The loss is: ',loss)
15. n=int(input('Enter the number'))
if n== 0:
print('The number you have entered is zero')
elif n>0:
print('The number is positive')
else:
print('The number is negative')
16. per = int(input('Enter the marks obtained'))
if per >= 90:
print('Excellent')
elif per >= 80:
print('Very Good')
elif per >= 60:
print('Good')
elif per >= 33:
print('Satisfactory')
else:
print('Needs Improvement')
17. Li=['English', 'Hindi', 'Maths', 'Science', 'Computer']
print(Li)
18. Di={'Uttar Pradesh':'Lucknow', 'Rajasthan':'Jaipur', 'Tamil Nadu':'Chennai',
'Maharastra':'Mumbai', 'Punjab':'Chandigarh'}
print(Di)
19. sub= ['Eng', 'Hindi', 'Maths', 'Science', 'Computer']
print(sub)
sub.insert(3,'Humanities')
print(sub[0:4])
print(sub[2:5:2])
20. states={'UP':'Lucknow','Odisha':'Bhuvaneshwar','Maharastra':'Bombay', 'Tamil
Nadu':'Chennai', 'Delhi':'Delhi'}
print(states)
states['Bihar']='Patna'
states['Maharastra']='Mumbai'
print(states)

You might also like