0% found this document useful (0 votes)
67 views

Practical File AI - Class 10

Uploaded by

Anya Singh
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)
67 views

Practical File AI - Class 10

Uploaded by

Anya Singh
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 10 – ARTIFICIAL INTELLIGENCE

PRACTICAL COPY
#Write a program in Python to print String in output Screen
# understanding output
print("Hello\nSir")
print("I am",end = " ")
print("Student of")
print("KV No 2 Sagar")
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input name and age and print it
#Program to Print Name and Age
nm = input("Enter your name : ")
age = input("Enter your age : ")

print("You are Mr. ", nm)


print("Your age is : ", age)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to add two numbers
# Program to add two numbers
a = int(input("Enter First number : "))
b = int(input("Enter Second number : "))
c=a+b
print(a, " + ", b," = ", c)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input 2 nos and print the addition and multiplication
#Program of Arithmetic Operator
a = int(input("Enter First number : "))
b = int(input("Enter Second number : "))

res1 = a + b
res2 = a * b

print(a," + ",b," = ", res1)


print(a," * ",b," = ", res2)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input an integer and print its square and cube
num = int(input("Enter any number :"))
sq = num*num
cu = num*num*num

print("Squre is ", sq)


print("Cube is ",cu)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input a number and irst 5 multiple of that number
#Program to print irst 5 multiple
num1 = int(input("Enter any number : "))

m2 = num1*2
m3 = num1*3
m4 = num1*4
m5 = num1 *5

print("First ive multiples are :")


print(num1, m2, m3, m4, m5)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input Principal, Rate and time and calculate Simple Interest
#Program of Simple Interest
pr = int(input("Enter Principal : "))
rate = int(input("Enter Rate : "))
ti = int(input("Enter Time : "))
si = pr * rate * ti/100
print("Simple Interest is : ,si)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input Principal, Rate and time and calculate Simple Interest
#Program of Quotient and Remainder
print("Program of Quotient and Remainder)
n1 = int(input("Enter First number : "))
n2 = int(input("Enter Second number : "))
R = n1 % n2
Q = n1 // n2
print("Quotient is : ",Q)
print("Remainder is : ",R)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input Principal, Rate and time and calculate Simple Interest
#Program to Calculate Rectangle
a =12
b=5
area = a * b
print("Length is : ",a)
print("Breadth is : ",b)
print("Area is ", area)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input your age and print present age, age after 5 and 10 yrs.
# Program to print age after 5 yr and after 10 yr
age = int(input("Enter your present age : "))
age5 = age + 5
age10 = age + 10
print("Your present age is : ", age)
print("Your age after 5 years : ", age5)
print("Your age after 10 years : ", age10)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input Cost Price and Selling Price and Print Pro it or Loss
#program of Pro it / Loss
print("Program - Pro it or Loss")
cp = int(input("Enter Cost Price : "))
sp = int(input("Enter Selling Price : "))

if(cp>sp):
ans = cp - sp
print("Loss for Rs. ",ans)
elif(sp>cp):
ans = sp - cp
print("Pro it for Rs. ",ans)
else:
print("No Pro it No Loss")
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input the marks of students and ind Pass or Fail
#Student pass or fail
mrk = int(input("Enter Marks of Student : "))

if(mrk >= 33):


print("Student pass")
else :
print("Student Fail")
print("Over")
--------------------------------------------------------------------------------------------------------------------------
# Write a program to input a number and ind whether it is Zero, Positive or negative
#Number to ind whether Positive, Negative or Zero
num = int(input("Enter any Number : "))
if(num>=0):
if(num==0):
print("Number is ZERO")
else:
print("Positive number")
else:
print("Negative number")
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input a number and print its absolute number.
#program Absolute
num = int(input("Enter any number: "))

if(num<0):
num = -1*num
print("Absolute number is :",num)
--------------------------------------------------------------------------------------------------------------------------
# Write a program in Python to input Marks and print the grade based on the marks
# Program to ind grade
print("Program to ind grade of student ")
nm = input("Student name : ")
mrk = int(input("Enter student marks : "))
if(mrk>=90):
print("Grade of ",nm," is A")
elif(mrk>=60):
print("Grade of ",nm," is B")
elif(mrk>=33):
print("Grade of ",nm," is C")
else :
print("Grade of ",nm," is F")
--------------------------------------------------------------- -----------------------------------------------------------
# Write a program in Python to input Marks and print the grade based on the marks

# Program of Table of any number


import time

t = int(input("Enter the number for table : "))


for x in range(1,11):
time.sleep(0.5)
print(t," * ",x," = ",t * x)

--------------------------------------------------------------------------------------------------------------------------

You might also like