Introduction to Artificial Intelligence

What is Artificial Intelligence (AI)? What is Artificial Intelligence (AI)? Artificial Intelligence (AI) refers to the ability of machines and computer systems to perform tasks that normally require human intelligence. These tasks include learning from experience, recognizing patterns, understanding natural language, solving problems, and making decisions. In simple words, AI enables computers to think, learn, […]

Python Program to Plot Monthly Sales Data of a Salesman on a Line Chart

Python Line Chart Example | Plot Monthly Sales Data using Matplotlib SOLUTION …… import matplotlib.pyplot as plt # Data months = [“January”, “February”, “March”, “April”, “May”, “June”] sales = [2500, 2100, 1700, 3500, 3000, 3800] # Plotting the line chart plt.plot(months, sales, marker=’o’, color=’blue’, linestyle=’-‘, linewidth=2) # Adding labels and title plt.title(“Monthly Sales Data of […]

Python OpenCV Program to Perform Basic Image Processing Tasks

OpenCV Python Program | Load, Convert, Crop, and Save Image Example SOLUTION…… import cv2 # (a) Load an image and give it a title img = cv2.imread(‘2.png’) # Replace ‘image.jpg’ with your image filename cv2.imshow(‘Original Image’, img) # (b) Change the colour of image and convert to grayscale gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cv2.imshow(‘Grayscale Image’, gray) […]

Python Program to Plot Bar Chart for Mobile Game Ratings

Python Bar Chart Example | Plot Mobile Game Ratings using Matplotlib SOLUTION ….. import matplotlib.pyplot as plt # Sample data games = [‘Pubg’, ‘FreeFire’, ‘MineCraft’, ‘GTA-V’, ‘Call of Duty’, ‘FIFA 22’] ratings = [4.5, 4.8, 4.7, 4.6, 4.1, 4.3] # Plotting the bar chart plt.bar(games, ratings, color=[‘orange’, ‘green’, ‘blue’, ‘red’, ‘purple’, ‘teal’]) # Adding title […]

Python Program to Plot Line Chart for Clothes Store Sales Data

Python Line Chart Example | Plot Clothes Store Sales Data using Matplotlib SOLUTION…. import matplotlib.pyplot as plt # Data months = [“March”, “April”, “May”, “June”, “July”, “August”] jeans = [1500, 3500, 6500, 6700, 6000, 6800] tshirts = [4400, 4500, 5500, 6000, 5600, 6300] shirts = [6500, 5000, 5800, 6300, 6200, 4500] # Plotting the line […]

Python Program to Check Whether a Number is a Palindrome or Not

Python Palindrome Number Program | Check Palindrome Example with Code SOLUTION  :-  # Program to check whether a number is a palindrome or not # Input from user num = int(input(“Enter a number: “)) # Reverse the number rev = 0 temp = num while temp > 0: digit = temp % 10 rev = […]

Python Program to Check Whether a Number is an Armstrong Number or Not

Python Armstrong Number Program | Check Armstrong Number Example SOLUTION. num = int(input(“Enter the number :- “)) temp = num sum = 0 while temp >0: rem = temp % 10 sum = sum + (rem *rem *rem) temp = temp//10 if sum == num: print(“Number is Armstrong……”) else: print(“Number is not Armstrong……”)

Python Program to Calculate Electricity Bill Based on Unit Charges

Python Program to Calculate Electricity Bill Based on Unit Charges SOLUTION . # Python Program to Calculate Electricity Bill # Input the number of units consumed units = float(input(“Enter total units consumed: “)) # Calculate bill according to the conditions if units