XI CS practical programs
XI CS practical programs
3 Factorial 4
4 Fibonacci Series 5
6 Palindrome 7
7 Display a Pattern 8
9 Arithmetic Operation 10
10 Counting in String 11
1
1. Area and Circumference of a Circle
Write a program to accept radius of a Circle from the user and display its Area and
Circumference. Area=𝝅𝒓𝟐 and Circumference=𝟐 𝝅𝒓
Coding:
area,circum=0.0,0.0
radius=float(input("Enter the radius to display area and circumference of a circle "))
area = 22/7*radius**2
circum = 2*22/7*radius
print("Area of a Circle %.2f " %area)
print('Circumference of a Circle %.2f ' %circum)
Output
Enter the radius to display area and circumference of a circle 3.4
Area of a Circle 36.33
Circumference of a Circle 21.37
2
2. Greatest of Four Numbers
CODING
OUTPUT
3
3.Factorial
CODING
OUTPUT
4
4. Fibonacci series
CODING:
OUTPUT
Fibonacci Series.....
0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
5
5. Maximum and Minimum from List
Write a program to find maximum and minimum number from the List without using
built-in function
CODING
OUTPUT
6
6. Palindrome
CODING
OUTPUT
7
7. DISPLAY A PATTERN
Write a program to print in the following pattern and Read n to print for number of lines
1
23
456
7 8 9 10
11 12 13 14 15
..
CODING
OUTPUT
1
23
456
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35 36
37 38 39 40 41 42 43 44 45
46 47 48 49 50 51 52 53 54 55
8
8. Count Odd and Even Numbers
CODING
OUTPUT
Enter How many numbers to be added in the List: 8
Enter 1 Number
15
Enter 2 Number
98
Enter 3 Number
-74
Enter 4 Number
23
Enter 5 Number
16
Enter 6 Number
9
Enter 7 Number
52
Enter 8 Number
-3
The Number of Odd numbers in the list is 4
The Number of Even numbers in the list is 4
9
9. Arithmetic Operation
Write a program that reads two numbers and an arithmetic operator and displays the
computed result.
CODING:
OUTPUT
10
10. Counting in String
Write a program to read a sentence and print Number of Upper case, Lower case,
vowels and digits present in it.
CODING
OUTPUT
11
11. Student Search in a Tuple
Write a program to input names of n students and store them in a tuple. Also input a
name from the user and find if this student is present in the tuple or not.
CODING:
OUTPUT
12
12. Student List using Dictionary
Write a program to create a dictionary with the roll number, name and marks of n
students in a class and displays the names of students who have marks above 75.
CODING
OUTPUT
How many students? 5
Enter details of students 1
Enter the Roll Number : 12101
Enter Name of the Student: Nakulan
Enter the mark 77
Enter details of students 2
Enter the Roll Number : 12501
Enter Name of the Student: Sujith
Enter the mark 74
Enter details of students 3
Enter the Roll Number : 12506
Enter Name of the Student: Bharath
Enter the mark 87
Enter details of students 4
Enter the Roll Number : 12604
Enter Name of the Student: Naresh
Enter the mark 90
Enter details of students 5
Enter the Roll Number : 12201
Enter Name of the Student: Vani
Enter the mark 70
Student with marks above 75 are :
{'Roll_No': 12101, 'Name': 'Nakulan', 'Marks': 77.0}
{'Roll_No': 12506, 'Name': 'Bharath', 'Marks': 87.0}
{'Roll_No': 12604, 'Name': 'Naresh', 'Marks': 90.0}
13