Class 11 IP Journal Programs with Python code DPS Bopal 2024 25 (1)
Class 11 IP Journal Programs with Python code DPS Bopal 2024 25 (1)
Eg if N is 10, Output: 1 1 2 3 5 8 13 21 34 55
8. WAP to print factors of N.
Eg if N is 20, Output: 1 2 4 5 10 20
9. WAP to print Armstrong numbers from 1 till N.
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 1
10. WAP to check if the entered number is Prime or not.
11. WAP to print prime numbers between two Numbers.
12. WAP to print HCF and LCM of 2 numbers entered by the user.
13. WAP to scan N and print table of N Eg. If N is 15 output: 15 x 1 = 15, 15 x 2 = 30 … 15 x 10 =
150
14. WAP to scan N and print Sum of Odd and Sum of Even numbers till N.
15. WAP to scan a Number and print the sum of all the digits of the entered number. Eg. N=
1234 Ans will be 10 (1+2+3+4)
16. WAP to store sum of odd values and sum of even values in osum and esum variable. Starting
from 1 to N. N is the input given by user.
17. WAP to enter a string and check upper case, lower case, digits, special characters available
in a string.
18. WAP to enter a string and separate all the words by space. Also count number of words
given in a string.
19. WAP to enter 10 elements in a List. Arrange and display those elements in descending order
without using readymade method.
20. WAP to enter a string and check its palindrome or not.
21. WAP to enter a number and check its palindrome or not.
22. WAP to Enter 5 names in a List, add a name into the list, insert a name into the list, Delete a
name from the list. Print length of each name available in the list.
23. WAP to merge 2 List.
24. WAP to define a dictionary with key as student roll number and value as 3 subject marks,
with 5 students records. Calculate total marks of each student and print.
25. WAP to enter emp number as key and Salary as value into the list. Enter 10 employee
details. Display the details of the employee who is getting maximum salary and minimum
salary.
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 2
Program Code:
python
print("Leap Year")
else:
print("Greatest number:", a)
print("Greatest number:", b)
else:
print("Greatest number:", c)
3. WAP to scan a number and check whether it is Odd, Even or Neutral (Zero)
if num == 0:
print("Neutral")
elif num % 2 == 0:
print("Even")
else:
print("Odd")
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 3
4. WAP to scan admn, name of student, 5 Subject marks, calculate Total and Average.
total = sum(marks)
average = total / 5
print("\nReport Card")
print("Name:", name)
5. WAP to print all numbers divisible by 7 between two numbers scanned by user.
if i % 7 == 0:
factorial = 1
factorial = i
print("Factorial:", factorial)
a, b = 1, 1
for _ in range(N):
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 4
print(a, end=" ")
a, b = b, a + b
if N % i == 0:
if num == sum_of_cubes:
is_prime = True
if num <= 1:
is_prime = False
if num % i == 0:
is_prime = False
break
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 5
for num in range(start, end + 1):
if num > 1:
is_prime = True
if num % i == 0:
is_prime = False
break
if is_prime:
hcf = min(a, b)
break
hcf -= 1
lcm = (a b) // hcf
print("HCF:", hcf)
print("LCM:", lcm)
14. WAP to scan N and print Sum of Odd and Sum of Even numbers till N
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 6
sum_even = sum(i for i in range(1, N + 1) if i % 2 == 0)
15. WAP to scan a Number and print the sum of all the digits of the entered number
python
16. WAP to store sum of odd values and sum of even values in osum and esum variable from 1 to N.
osum, esum = 0, 0
if i % 2 == 0:
esum += i
else:
osum += i
17. WAP to enter a string and check upper case, lower case, digits, special characters.
if char.isupper():
upper += 1
elif char.islower():
lower += 1
elif char.isdigit():
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 7
digits += 1
else:
special += 1
print("Digits:", digits)
18. WAP to enter a string, separate all words, and count the number of words.
words = string.split()
19. WAP to enter 10 elements in a list and arrange in descending order without using readymade
method.
for i in range(len(elements)):
if string == string[::-1]:
else:
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 8
21. WAP to enter a number and check if it's a palindrome.
if num == num[::-1]:
else:
22. WAP to enter 5 names in a list, add, insert, delete a name, and print the length of each name.
names.append(new_name)
names.insert(1, insert_name)
if delete_name in names:
names.remove(delete_name)
24. WAP to define a dictionary with student roll numbers as keys and marks as values, then calculate
total marks.
students = {}
for i in range(5):
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 9
roll_no = input(f"Enter roll number for student {i+1}: ")
students[roll_no] = marks
total = sum(marks)
25. WAP to enter emp number as key and Salary as value into a dictionary, find max and min salary.
employees = {}
for i in range(10):
employees[emp_no] = salary
Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 10