0% found this document useful (0 votes)
7 views2 pages

Class 11 Python Programs With Outputs

The document contains Python programs for various tasks, including calculating the area and perimeter of shapes, finding factorials, checking for palindromes and prime numbers, and generating patterns. It also includes programs for counting vowels, identifying the longest word, categorizing numbers into even and odd lists, combining lists, and displaying character occurrences. Sample outputs for each program are provided to illustrate their functionality.

Uploaded by

pastudents023
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Class 11 Python Programs With Outputs

The document contains Python programs for various tasks, including calculating the area and perimeter of shapes, finding factorials, checking for palindromes and prime numbers, and generating patterns. It also includes programs for counting vowels, identifying the longest word, categorizing numbers into even and odd lists, combining lists, and displaying character occurrences. Sample outputs for each program are provided to illustrate their functionality.

Uploaded by

pastudents023
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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)

You might also like