CLASS 11 – COMPUTER SCIENCE
Python Programs with Sample Outputs
Program 1: Area and Perimeter of Circle, Rectangle, Square
Sample Output:
Circle Area: 78.5 Perimeter: 31.4
Rectangle Area: 20 Perimeter: 18
Square Area: 16 Perimeter: 16
Program 2: Factorial of a number
Sample Output:
Enter a number: 5
Factorial is: 120
Program 3: Palindrome Check
Sample Output:
Enter a number: 121
Palindrome Number
Program 4: Prime Number Check
Sample Output:
Enter a number: 7
Prime Number
Program 5: Star & Number Pattern
Sample Output:
*
**
***
1
12
123
Program 6: Count Vowels
Sample Output:
Enter a string: Hello
Number of vowels: 2
Program 7: Longest Word
Sample Output:
Enter a sentence: Python is powerful
Longest word: powerful
Program 8: Even and Odd List
Sample Output:
Even: [2, 4, 6]
Odd: [1, 3, 5]
Program 9: Combine Two Lists
Sample Output:
Combined List: [1, 2, 3, 4, 5, 6]
Program 10: Tuple Occurrence
Sample Output:
Enter element: 2
Element repeated 3 times
Program 11: Number Name
Sample Output:
69 - Six Nine
Program 12: Character Occurrence
Sample Output:
a:2
b:1
Program 13: Fibonacci Series
Sample Output:
Enter number of terms: 5
Fibonacci Series: (0, 1, 1, 2, 3)