Add A Heading
Add A Heading
FILE
FOR AI
PARTH PARATE
CLASS 10 B
ROLL NO. 26
1. Program to Check
Uppercase, Lowercase, Digit,
or Special Character
char = input("Enter a character: ")
if char.isupper():
print(f"{char} is an uppercase letter.")
elif char.islower():
print(f"{char} is a lowercase letter.")
elif char.isdigit():
print(f"{char} is a digit.")
else:
print(f"{char} is a special character.")
2. Program to Find
Maximum of Three
Numbers
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
c = int(input("Enter third number: "))
maximum = max(a, b, c)
print("The maximum number is”, maximum)
3. Program for Electric
Power Distribution
Charges
customer_number = input("Enter customer
number: ")
units_consumed = float(input("Enter power
consumed in units: "))
if sum == num:
print(f"{num} is an Armstrong number.")
else:
print(f"{num} is not an Armstrong
number.")
5. Program to Print
Multiplication Table
num = int(input("Enter a number: "))
6. Program to Generate
the Pattern
n=5
num = 1
for i in range(1, n + 1):
for j in range(i):
print(num, end=" ")
num += 1
print()
7. Program to Find Maximum
in a List of Students' Marks
marks = [int(input(f"Enter marks for
student {i + 1}: ")) for i in range(5)]
print(f"The maximum marks obtained is:
{max(marks)}")
8. Program to Create a 2D
Array Using NumPy
import numpy as np
print("2D Array:")
print(array)
9. Program to Convert a
Python List to a NumPy Array
import numpy as np
list1 = [1, 2, 3, 4, 5]
array1 = np.array(list1)
print(f"NumPy array: {array1}")
plt.bar(games, ratings)
plt.xlabel('Games')
plt.ylabel('Ratings')
plt.title('Ratings of Mobile Games')
plt.show()
12. Program to Plot Data on
Clothes Store Sales in Line
Chart
import matplotlib.pyplot as plt
plt.xlabel('Months')
plt.ylabel('Sales')
plt.title('Clothes Store Sales')
plt.legend()
plt.show()
13. Program to
Calculate Mean, Mode,
and Median
import statistics
data = [5, 6, 1, 3, 4, 5, 6, 2, 7, 8, 6, 5, 4, 6, 5, 1, 2,
3, 4]
mean = statistics.mean(data)
mode = statistics.mode(data)
median = statistics.median(data)
print(f"Mean: {mean}")
print(f"Mode: {mode}")
print(f"Median: {median}")
14. Program to Read
CSV File and Display
10 Rows
import csv