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

Class X Practical Program

Hnn

Uploaded by

ft.kxsh155
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Class X Practical Program

Hnn

Uploaded by

ft.kxsh155
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Practical Program ( X Std )

Program 1

Aim: Write a program to find sum of n numbers and find average.

Program:
num=int(input("enter the number"))
sum=0
i=1
while(i<=num):
sum=sum+i
i=i+1
print("the sum is ", sum)
avg=sum/num
print("the avergae is ",avg)

Result: Thus the program is executed and the output verified.

Output
enter the number: 10
The sum is : 55
The average is 5.5

Program 2

Aim: Write a program to check whether the given character is an uppercase letter or
lowercase letter .

Program:
ch = input("Please Enter Your Own Character : ")
if(ch.isupper()):
print(ch, "is an Uppercase Alphabet")
elif(ch.islower()):
print( ch, "is a Lowercase Alphabet")
else:
print( ch, "is Not a Lower or Uppercase Alphabet")

Result: Thus the program is executed and the output verified.

Output:
Please Enter Your Own Character: A

A is an Uppercase Alphabet
Program 3:

Aim:
Write a program to generate a pattern.
1
12
123
1234
12345

Program:
rows = int(input(“enter the rows:”))
for i in range(1, rows+1):
for j in range(1, i+1):
print(j, end=' ')
print("")

Output: Enter the rows: 5


1
12
123
1234
12345

Program 4

Aim:
Write a program to find the maximum number out of the given three numbers.

Program:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
num3 = int(input("Enter third number: "))
if (num1 >= num2) and (num1 >= num3):
largest = num1
elif (num2 >= num1) and (num2 >= num3):
largest = num2
else:
largest = num3
print("The largest number is", largest)

Result:
Thus the program is executed and the output verified.
Output:
Enter first number: 10
Enter second number: 20
Enter third number: 30
The largest number is 30
Program 5:
Aim:
Write a program to represent the data on the ratings of mobile games on bar chart. The
sample data is given as: Pubg, FreeFire, MineCraft, GTA-V, Call of duty, FIFA 22. The
rating for each game is as: 4.5,4.8,4.7,4.6,4.1,4.3.

Program :
import matplotlib.pyplot as plt

games=['Pubg', 'FreeFire', 'MineCraft', 'GTA-V','Call of duty', 'FIFA 22']

rating=[4.5,4.8,4.7,4.6,4.1,4.3]

plt.bar(games,rating,color=['black', 'red', 'green', 'blue', 'yellow','pink'])

plt.title("Games Rating 2022")

plt.xlabel('Games')

plt.ylabel('Rating')

plt.show()

Output:

You might also like