AI_project_file_Class IX
AI_project_file_Class IX
Artificial Intelligence
Subject Code : 417
Submitted by :
Name: ___________________________
Class/Sec : ________________________
ACKNOWLEDGEMENT
2. Square of a Number Write a Python program to find and display the square of the number 7.
-Code: # Define the number
number = 7
# Calculate the square of the number
square = number * number
# Display the result
print(f"The square of {number} is {square}.")
Output:
3. Sum of Two Numbers Create a Python program to calculate and print the sum of two numbers, 15 and 20.
Code: # Define the two numbers
number1 = 15
number2 = 20
# Calculate the sum of the two numbers
sum_of_numbers = number1 + number2
# Display the result
print(f"The sum of {number1} and {number2} is {sum_of_numbers}.")
Output:
7. Area of a Triangle
Code: # Define the base and height of the triangle
base = 8 # example value
height = 5 # example value
# Calculate the area of the triangle
area = 0.5 * base * height