Professional Documents
Culture Documents
Science
Practical
File
Name – Bani Galhotra
Class – XIIth – B
Roll No. – N07B
Submitted to – Mr. Anish Sir
5 To display table company which are having prize less than 30000
6 To display the name of the companies in reverse alphabetical
order
7 To add one more column total price with decimal] 10,2) to the
table customer
8 Select count(*), CITY from COMPANY group by CITY;
print(x)
print(y)
z = ('He is\tawesome')
print(z)
print(w)
Output:-
He is awesome
\" \n \t \'
Output:-
Enter first 11
Results:-
Addition 16
Subtraction 6
Multiplication 55
Division 2.2
Modulus 1
Floor Division 2
Exponentiation 161051
Program 3 - Write a program to find
whether an input number is perfect or not?
sum1 = 0
if n % x == 0:
sum1 = sum1 + x
if (sum1 == n):
else:
print("The number is not a Perfect number!")
Output:-
factorial = 1
if num < 0:
elif num == 0:
else:
factorial = factorial*i
print("The factorial of",num,"is",factorial)
Output:-
Enter a number: 4
The factorial of 4 is 24
s=0
for i in range(1,n+1):
a=int((i**i)/i)
s=s+a
print ("The sum of the series is ", s)
Output:-
Enter a value of n 5
The sum of the series is 701
Output:-
The principal amount is 13000
Output:-
What do you want to find area of:-
Enter 'sq' for square, 'rect' for rectangle, 'cir' for circle sq
Enter side of the square 5
Area for Square is 25.0
Output:-
What do you want to find area of:-
Enter 'tsa' for Total surface area, 'lsa' for Lateral surface area tsa
Output:-
What do you want to find area of:-
Enter 'tsa' for Total surface area, 'lsa' for Lateral surface area tsa
Enter breath of the cuboid 6
Enter height of the cuboid 7
Enter length of the cuboid 9
Total surface area for cuboid is 318.0
Output:-
What do you want to find area of:-
Enter 'tsa' for Total surface area, 'lsa' for Lateral surface area tsa
Enter radius of the cone 6
Enter slant height of the cone 9
Total surface area for cone is 282.857
Output:-
What do you want to find Volume of:-
Enter 'cube'-cube, 'cub'-cuboid, 'cyl'-cylinder, 'cone'-cone,'sp'-sphere cube
Enter side of the cube 6
Volume for cube is 216.0
Output:-
What do you want to find area of:-
Enter 'tsa' for Total surface area, 'lsa' for Lateral surface area tsa
Enter radius of the hemisphere 14
Total surface area for hemisphere is 1848.0
Program 15 - Write a program to find
weather input number is prime or composite.
num = int(input("Enter a number: "))
if num > 1:
for i in range(2,num):
if (num % i) == 0:
print(num,"is not a prime number")
break
else:
print(num,"is a prime number")
else:
print(num,"is not a prime number")
Output:-
Enter a number: 345
345 is not a prime number
Output:-
Enter value of n 6
Sum of squares = 91
Output:-
Enter value of n 5
Sum of cubes = 225
Output:-
Enter first number 3458
Enter second number 7489
Enter third number 25
Enter fourth number 90743
Largest number is 90743
Smallest number is 25
Output:-
Guess the number between 1 and 100
Enter any number 60
Too high!
Enter number again 15
Too high!
Enter number again 10
Too low
Enter number again 12
you guessed it right!!