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

AI code

Uploaded by

chopravansh184
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)
10 views

AI code

Uploaded by

chopravansh184
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/ 9

SESSION 2024-25

PRACTICAL FILE
OF
ARTIFICIAL INTELLIGENCE

CLASSX

UNDER THE SUPERVISION OF


Mrs.

SUBMITTED BY
ANSH GUPTA
4
Clear

==

ful
Success

Enter
the
number7
ome.Gupta
Ansh Execution
palindr

Output Code
by
a
is made
===
7

Run

ome,")
number:"))
Sove palindrome."")
isa
print({number}
[::-1] palindr

(num) ):
:(num)thepalindrome_native(number
a
Str notGupta)
("Enter
palindrome_native
is
=
str(num) print(f{number}
Arsh
number=int(input
by
return 84(made

is ís_
main.py 615e:
def 1f

2 3 4 5
Clear

18]
=
8, Successful
10,
8,
[5, Ansh
Gupta ExeCcution
list:

OutputResultant
dema
by RCOde

Run

list2[1])
Save
list)

(listt[i]
result
Gupta")
range(len(list1)):
list:",
L 81 10] append
5, Ansh
4, 6, [] result_list.
print("Resultant
[1,3,5, = by
[4,result_list print("made
= = in
list1list2 i
main.py for
3 4 5
7
Clear

Successful

y:7 y:5
x:5
7
y: GuptaExecution
and and
the
numberBefore
swapping:
number
Enter After
swapping:
5 x:7
Ansh
X:
Output the of of Code
by
Enter Value Value
made
==

Run

Save x:))
y:"))
y) y)
y:", y:",
number
number
"and "andGupta)

thetheprint("Before
Swapping:
")
x, swapping:")
print(After
X,
X:,
("Enter
int(input(Enter x:,
Ansh

of of by
int(input
print(Value
print(Value
x (made
=y,

main.pPy X,y print


X==
y
2 5 7 8
Clear

===

61; 83:
subject
52:subject
subject
Successful
6 9
4: 5:
subject
subject
Marks=6.80
GuptaExecution
for for for for for
marks
Enter
ks
marks
mar
Enter
Enter Ansh
ks
mar
Enter
ks
Output mar
by Code
Average
Enter made
2

)3subject
)
Run
1
subject
2))) "))5:))
subiect
subject4:
Save subiect
2f}")
5
forforforforfor m5)
marks
int(input("Enter
{avg:
marks ks marks
marks ta")
mar m4
int(input("Enter Gup
int(input("Enter
int(input("Enter
int(input("Enter
Marks
m3 Ansh
(f'Average
m2 by
+ print("made
(m1

main.py
= = print
avg
m1 m2 m3 m4 mS

2 3 4 5 6 8
9 else:
8 7 5 4 2 1
main.py
print( ifnum def
check_palindrome
print({num}
print( reversed_number
= check_
return
int(input("Enter
madé
palindrome
by
{num} int(reversed
Ansh
1s 1s
Gupta") not (num) =
a (number):
a str
palindrome
:
number)
a number (number
palindrome

==
number")
[::-1] )
number
) Save

number")

Run

made 7
Enter
is Output
Successful==
Execution
Code
by a a
palindrome
Ansh number:

Gupta
7
number

Clear
8 3
while
True: 4 main.py
num1
pr max num2
intmade
nummax = if nun =
break int(input("Enter
int(input(Enter
prmax =
max
by int num
{max_num})
("LC# (num1.
Ansh %
num1
Gupta") Of num2
==0
{num1} )the the
and
secondfirst
and max
{num2} num nunber:
number Save

%
is: num2 "))
Run
*
0

made LCMEnterEnter
Output
SUccesSful
ExeCution
Code by 0f
Ansh 100 the the
first
second
and
Gupta
9887
number
number:
is:
:
988700 100
9887

Clear
Clear

Gupta
elements):
Ansh
Successful
==
Execution
by
1O made
(first
34
21
13
series
8
011235
Fibonacci
Output Code
===

Run
elementS):")

Save

10
(firSt
Gupta")
series
")
end="
print(n1,
nth Ansh
range(10):
for
in
n2 n2,
print("Fibonacci
+ by
1
n1 = (made
=0,
= n2
nthn1,
n2 print
main.py
n1,

1
2 3 4 5 6 7
24 75.20°F
=
Celsius: Successful

to
in equivalent
ta Execution
temperature
Gup
Ansh
is
by Code
24.00°C
Enter
made
=R

temp
temparaturein
it(celsius
to
equivalent

32 fahrenhe
fahrenheit(celsius):
*9/5)+
float(input("Enter
is temp:2f}°F)
{fahrenheit
to temp:2f}°C
ta)
(celsius celsius
Gup
fahrenheit
return
Ansh
- print("{celsius
Celsius:))
temp
to fahrenheit by
temp print("made
celsius fahrenheit
celsius
def

5
7
2 3 4

You might also like