0% found this document useful (0 votes)
3 views5 pages

Python Basic Programs - 2024-25

Uploaded by

TECH Queen
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)
3 views5 pages

Python Basic Programs - 2024-25

Uploaded by

TECH Queen
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

Grade 11 PYTHON Programs (Session 24-25)

BASIC Programs
1. WAP to add 2 numbers.
2. WAP to find area of Rectangle.
3. WAP to find area of circle.
4. WAP to find simple interest.
5. WAP to swap 2 numbers with 3rd variable.
6. WAP to swap 2 numbers without 3rd variable.
7. WAP to input a number and print its first five multiplies.
8. WAP to enter marks in 3 subjects each out of 100 and calculate
total and percent.
9. WAP to enter temperature in Fahrenheit and convert it into
Celsius.
10. WAP that accepts cost price and quantity of product from the
user. Calculate and display the total price.

IF-ELSE Programs
1. WAP to find maximum of 2 numbers.
2. WAP to check whether a number is even or odd.
3. WAP to check whether a number is positive or negative or zero.
4. WAP to enter marks in 3 subjects each out of 100 and calculate
percent. Print some appropriate message if percent exceeds
80%.
5. WAP to check whether a person is eligible for voting or not.
6. WAP to find maximum of 3 numbers.
7. WAP to enter percent of a student and print its division
according to the given criteria.
PER DIV
>80 I
<80 and >60 II
<60 and >40 III
Otherwise ‘Fail’
8. WAP to check whether inputted year is the leap year or not.
For Loop Programs
1. WAP to print your name 10 times.
2. WAP to print first 10 natural numbers.
3. WAP to add first 10 natural numbers.
4. WAP to add 10 random numbers.
5. WAP to find average of N numbers.
6. WAP to find maximum of N numbers.
7. WAP to count total even and odd numbers out of N numbers.
8. WAP to print 1,2,3,4,5,...... till N
9. WAP to print 2,4,6,8...... till N
10. WAP to print a multiplication table of a given number
11. WAP to get the Fibonacci series between 0 to 50.
12. WAP to print all the even numbers within the given range.
13. WAP to calculate the sum of all numbers from 1 to a given
number.
14. WAP to find whether number is palindrome or not.
While Loop Programs
1. Write a program to print numbers from 1 to a user-defined
number N.
2. Write a program to find the sum of the digits of a given number.
Generate the following patterns using nested
loops
* ***** 1
** **** 1 2
*** *** 1 2 3
**** ** 1 2 3 4
***** * 1 2 3 45
1 12345 5 4 3 21
22 1234 4 3 2 1
333 123 3 2 1
4444 12 2 1
55555 1 1

List and Dictionaries Programs


1. WAP to find the first largest and second largest elements in a
given list of elements. List should be taken input from the user.
2. WAP to calculate average marks of n students where n is
entered by the user.
3. WAP to check if a number is present in the list or not. If the
number is present, print the position of the number. Print an
appropriate message if the number is not present in the list.

4. WAP to enter a month number and print its corresponding day


name.
(HINT: 1-January, 2-Feburary,……)
5. WAP to print all the numbers divisible by 9 from a given list.
6. write a program to find the number of times an element occurs
in the list.
7. write a program to read a list of n integers (positive as well as
negative). Create two new lists, one having all positive numbers
and the other having all negative numbers from the given list.
Print all three lists.
8. Write a Python program to input two lists of numbers from the
user. Create a third list where each element is the sum of the
corresponding elements from the two input lists. Print the third
list.
Example:
If the user inputs:
List 1: 1 2 3
List 2: 4 5 6
The output should be:
List 3: [5, 7, 9]
9. Write a program to find the largest and the second largest
element in a given list of elements.
10. Write a program to read a list of n integers and find their
median.
Note: the median value of a list of values is the middle one when they
are arranged in order. If there are two middle values then their
average.
Hint: use an inbuilt function to sort the list.
11. Create a dictionary ‘ODD’ of odd numbers between 1 and 10,
where the key is the decimal number and the value is the
corresponding number in words.
 Display the keys in dictionary ‘ODD’.
 Display the values in dictionary ‘ODD’
11. WAP to find the first largest and second largest elements in a
given list of elements. List should be taken input from the user.
2. WAP to calculate average marks of n students where n is
entered by the user.
3. WAP to check if a number is present in the list or not. If the
number is present, print the position of the number. Print an
appropriate message if the number is not present in the list.
4. WAP to enter a month number and print its corresponding day
name.
(HINT: 1-January, 2-Feburary,……)
5. WAP to print all the numbers divisible by 9 from a given list.
6. write a program to find the number of times an element occurs
in the list.
7. write a program to read a list of n integers (positive as well as
negative). Create two new lists, one having all positive numbers and
the other having all negative numbers from the given list. Print all
three lists.
8. Write a program to find the largest and the second largest
element in a given list of elements.
9. Write a program to read a list of n integers and find their
median.
12. write a program to rea d a list of elements. Modify this list so
that it does not contain any duplicate elements i.e. all elements
occurring multiple times in the list should appear only once.
13. Write a program to create a list of elements. Input an element
from the user that has to be inserted in the list. Also input the
position at which it is to be inserted.
14. Write a program to read elements of a list and do the following.
a) The program should ask for the position of the elements to
be deleted from the list and delete the element at the desired
position in the list.
b) The program should ask for the value of the element to be
deleted from the list and deleted from this value from the list.
15. Write a python program to find the highest 2 values in a
dictionary.
16. Write a program to create a dictionary from a string
‘w3resource’ such that each individual character mates a key and
its index value for first occurrence males the corresponding value in
dictionary.
Expected output: {‘3’:1, ‘s’:4, ‘r’:2, ‘u’:6, ‘w’:0, ‘c’:8, ‘e’:3, ‘o’:5}
17. Write a program to input your friend’s, names and their phone
numbers and store them in the dictionary as their key-value pair.
Perform the following operations on the dictionary:
a) Display the name and phone number for all your friends.
b) Add a new key value pair in this dictionary and display the
modified dictionary.
c) Delete a particular friend from a dictionary.
d) Modify the phone number of an existing friend.
e) Check if a friend is present in the dictionary or or not.
f) Display the dictionary in sorted order of names.

*************************************************************************************
**********

You might also like