0% found this document useful (0 votes)
11 views62 pages

Python Programs for Class 12 Students

The document outlines a series of programming exercises for Class 12 students, covering various topics such as input handling, pattern printing, number theory, and string manipulation. Each program includes a brief description of its functionality, such as checking for perfect squares, Armstrong numbers, and calculating factorials. The document serves as a practical guide for students to enhance their programming skills in Python.

Uploaded by

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

Python Programs for Class 12 Students

The document outlines a series of programming exercises for Class 12 students, covering various topics such as input handling, pattern printing, number theory, and string manipulation. Each program includes a brief description of its functionality, such as checking for perfect squares, Armstrong numbers, and calculating factorials. The document serves as a practical guide for students to enhance their programming skills in Python.

Uploaded by

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

PROGRAM FILE

CLASS 12

NAME –DAKSH SAINI


CLASS – XII – A

PROGRAM – 1
WRITE A PROGRAM THAT TAKES
TWO INTEGERS AS INPUT AND
PRINTS A MESSAGE INDICATING A
LARGER NUMBER

OUTPUT

PAGE 1
PROGRAM 2

PAGE 2
WRITE A PROGRAM THAT TAKES A
NUMBER NUM FROM THE USER AND
PRINTS THE FOLLOWING PATTERNS FOR
NUM LINES :

PATTERN 1 PATTERN 2 PATTERN 3


* 12345 A
** 1234 AB
*** 123 ABC
**** 12 ABCD
***** 1 ABCDE

PAGE 3
PAGE 4
Output

PAGE 5
Program 3
Write a program that takes as an input
and checks whether it is perfect square or
not. In number theory,a perfect number is
positive integer that is equal to the sum of
its positive divisors,excluding the number
itself.

PAGE 6
Output

Program 4

PAGE 7
Write a program that a number as an
input and checks whether it is an
Armstrong number or not . The Armstrong
number is a number that is equal to the
sum of the cubes of its digits. For
example,0,1,153,370,371 and 407 are the
Armstrong numbers

Output

PAGE 8
Program 5

PAGE 9
Output

PAGE 10
Program 6
Write a program to find largest among
three integers

PAGE 11
Output

PAGE 12
Program 7
Write a program that accepts the age and
print if one is eligible to vote or not.

PAGE 13
Output

PAGE 14
Program 8
Write a program to accept the year and
check if it is a leap year or not.

PAGE 15
Output

PAGE 16
Program 9
Write a program to create a triangle of
stars using nested loop.

PAGE 17
Output

PAGE 18
Program 10

PAGE 19
Write a Python script to print Fibonacci
series’ first 10 elements.

Output

PAGE 20
Program 11
Write a python script to input two
numbers and print their LCM and HCF.

PAGE 21
Output

PAGE 22
Program 12
Write a python script to calculate the sum
of the following series:

PAGE 23
S=(1)+(1+2)+(1+2+3)+……+(1+2+3+
….+n)

Output

PAGE 24
Program 13

PAGE 25
A program that reads a line and prints its
statistics like:
The number of uppercase letters:
The number of lowercase letters:
The number of alphabets:
The number of digits:

Output

PAGE 26
Program 14
Write a program that takes a string with
multiple words and then capitalizes the

PAGE 27
first letter of each word and forms a new
string out of it.

Output

PAGE 28
Program 15

PAGE 29
Write a program that reads a string and
displays the longest substring of the given
string having just the consonants.

Output

PAGE 30
Program 16

PAGE 31
Write a program that reads a string and
then prints a string that capitalizes every
other letter in the string.

output

PAGE 32
Program 17
Write a program that reads the email id of
a person in the form of a string and

PAGE 33
ensures that it belongs to domain
@[Link] (Assumption: no invalid
characters are there in email-id)

Output

PAGE 34
Program 18

PAGE 35
PAGE 36
Output

PAGE 37
Program 19

PAGE 38
Output

Program 20

PAGE 39
Write a Python program to remove an
item from a tuple

Output

PAGE 40
Program 21
Factorial calculator

PAGE 41
Output

PAGE 42
Program 22
Simple Interest Calculator

PAGE 43
Output

PAGE 44
Program 23
Convert Celsius to Fahrenheit:

PAGE 45
Output

PAGE 46
Program 24
Quadratic Equation Solver

PAGE 47
Output

PAGE 48
Program 25

PAGE 49
String reversible

Output

PAGE 50
Program 26
Count Vowels in a String

PAGE 51
Output

PAGE 52
Program 27

PAGE 53
Merge Two Lists

Output

PAGE 54
Program 28
Sum of Squares of First N
Natural Numbers

PAGE 55
Output

PAGE 56
Program 29
Check if a String Contains Only Digits

PAGE 57
Output

PAGE 58
Program 30
Check if a List is Sorted

PAGE 59
Output

PAGE 60
PAGE 61

You might also like