0% found this document useful (0 votes)
2 views30 pages

CS Prctical File Class XI

The document contains a series of Python programming exercises aimed at 11th-grade students, covering various topics such as input/output operations, conditional statements, loops, and data structures like lists, tuples, and dictionaries. Each exercise includes a description of the task, coding requirements, and expected output. The exercises are designed to enhance students' programming skills through practical application.

Uploaded by

arizabbas407
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)
2 views30 pages

CS Prctical File Class XI

The document contains a series of Python programming exercises aimed at 11th-grade students, covering various topics such as input/output operations, conditional statements, loops, and data structures like lists, tuples, and dictionaries. Each exercise includes a description of the task, coding requirements, and expected output. The exercises are designed to enhance students' programming skills through practical application.

Uploaded by

arizabbas407
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
You are on page 1/ 30

Name: Sameer Mishra

Grade and section: 11


–F

Subject: Computer
Science

1
2
INDEX
Pr. Da Topic Page Teacher’
No te no s
sign
1 Write a python program to input a welcome message and display
it.
2 Write a python program to input two numbers and display the
larger /
smaller number.
3 Write a python program to input three numbers and display the
largest
/smallest number.
4 Generate the following patterns using nested loop.

5 Write a program to input the value of x and n and print the sum of
the following series:
a.1 + x2 + x3 + ... + xn
b. x - x2/2! + x3/3! - x4/4! + x5/5! - x6/6!

6 Write a program to determine whether a number is a perfect


number, an
Armstrong number or a palindrome.
7 Write a program to input a number and check if the number is a
prime
or composite number.
8 Write a program to display the n terms of a Fibonacci series.
9 Write a python program to compute the greatest common divisor
and
least common multiple of two integers.
10 Write a program to count and display the number of vowels,
consonants,
uppercase, lowercase characters in string.
11 Write a menu driven program for list manipulation. Display menu
as:
1.Add a record
2.View record
3.Delete Record
4.Modify record
5.Exit

3
12 Write a menu drive program to the following from the list:
1.Maximum
2.Minimum
3.Sum

4.Sort in Ascending
5.Sort in Descending
6.Exit

13 Write a program to input a list of numbers and swap elements


at the
even location with the elements at the odd location.
14 Write a program to input a list of number and interchange first
element
to last element.
15 Write a program to create a tuple with user input and search
for given
element.
16 Write a program to create tuple with user input and display the
square
of numbers divisible by 3 and display cube of numbers divisible
by 5.
17 Write a menu driven program to do the following using a
dictionary.
1.Display Contacts
2.Add Contact
3.Delete a Contact
4.Change a phone number
5.Search Contact
6.Exit
18 Write a program to Create a dictionary with the roll number,
name and marks of n students in a class and display the names
of students who
have scored marks above 75.
19 Write a program to create a dictionary and store salesman
name as a key and sales of 3 months as values. Give the bonus
to the salesman according to the given criteria:
1.Total Sales < 10K – No Bonus
2.Total Sales 10K to 20K – 5%
3.Total Sales 21K to 30K – 8%
4.Total Sales 31K to 40K – 10%

4
20 Write a program to enter a team name, wins and losses of a
team. Store them into a dictionary where teams names are key
and winds and losses are values stored as a list. Do the
following based on the dictionary created above:
• Find out the team’s winning percentage by their names
• Display the no. of games won by each team in a list
• Display the no. of games lost by each team in a list

5
Ex.No:-
1 PROGRAM TO INPUT A WELCOME MESSAGE AND DISPLAY IT

Date:-

Aim:

Write a Python program to input a welcome message and display it.

Coding:

Output:

6
Ex.No:- 2 Write a python program to input two numbers and display the larger /smaller
number

Date:-

code:

output:

7
EX No.3 Write a python program to input three numbers and display the largest/smallest
number.

Code:

Output:

EX No.4 Generate the following patterns using nested loop.


8
Code:

Output:

9
EX No.5 Write a program to input the value of x and n and print the sum of the following series:
a. 1 + x2 + x3 + ... + xn
b. x - x2/2! + x3/3! - x4/4! + x5/5! - x6/6!

Code for a :

Output:

Code for b:

10
Output:

EX No.6 Write a program to determine whether a number is a perfect number, an Armstrong


number or a palindrome.

11
Code:

Output:

EX No.7 Write a program to input a number and check if the number is a prime or composite
number

12
Code:

Output:

Ex No.8 Write a program to display the n terms of a Fibonacci series.

Code:

13
Output:

EX No.9 Write a python program to compute the greatest common divisor and least common
multiple of two integers.

Code:

14
Output:

EX no.10 Write a program to count and display the number of vowels, consonants, uppercase,
lowercase characters in string.

Code:

15
Output:

EX No.11 Write a menu driven program for list manipulation. Display menu as:
1.Add a record
2.View record
3.Delete Record
16
4.Modify record
5.Exit

Code:

17
Output:

18
EX No.12 Write a menu drive program to the following from the list:
1.Maximum
19
2.Minimum
3.Sum
4.Sort in Ascending
5.Sort in Descending
6.Exit
Code:

Output:

20
EX No.13 Write a program to input a list of numbers and swap elements at the even location with
the elements at the odd location.
21
Code:

Output:

EX No.14 Write a program to input a list of number and interchange first element to last element.

22
Code:

Output:

EX No.15 Write a program to create a tuple with user input and search for given element.

Code:

23
Output:

EX No.16 Write a program to create tuple with user input and display the square of numbers
divisible by 3 and display cube of numbers divisible by 5.

Code:

24
Output:

EX No.17 Write a menu driven program to do the following using a dictionary.


1. Display Contacts
2. Add Contact
3. Delete a Contact
4. Change a phone number
25
5. Search Contact
6. Exit

Code:

Output:

26
27
EX No.18 Write a program to Create a dictionary with the roll number, name and marks of n
students in a class and display the names of students who have scored marks above 75.

Code:

Output:

28
EX No.19 Write a program to create a dictionary and store salesman name as a key and sales of
3 months as values. Give the bonus to the salesman according to the given criteria:
1.Total Sales < 10K – No Bonus
2.Total Sales 10K to 20K – 5%
3.Total Sales 21K to 30K – 8%
4.Total Sales 31K to 40K – 10%

Code:

Output:

Ex No.20 Write a program to enter a team name, wins and losses of a team. Store them into a
dictionary where teams names are key and winds and losses are values stored as a list. Do the
following based on the dictionary created above:
29
• Find out the team’s winning percentage by their names
• Display the no. of games won by each team in a list
• Display the no. of games lost by each team in a list

Code:

Output:

30

You might also like