0% found this document useful (0 votes)
5 views

Class 11 IP Journal Programs with Python code DPS Bopal 2024 25 (1)

The document outlines the journal program requirements for class XI Informatics Practices at Delhi Public School-Bopal, Ahmedabad for the academic year 2024-25. It includes a list of programming tasks that students must complete, emphasizing neatness, proper formatting, and specific coding instructions. Each task requires students to write and test code, document outputs, and follow guidelines for presentation in their journals.

Uploaded by

rivashah0908
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Class 11 IP Journal Programs with Python code DPS Bopal 2024 25 (1)

The document outlines the journal program requirements for class XI Informatics Practices at Delhi Public School-Bopal, Ahmedabad for the academic year 2024-25. It includes a list of programming tasks that students must complete, emphasizing neatness, proper formatting, and specific coding instructions. Each task requires students to write and test code, document outputs, and follow guidelines for presentation in their journals.

Uploaded by

rivashah0908
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Delhi Public School-Bopal, Ahmedabad

Informatics Practices : Journal Programs, class XI : 2024-25


Date of submission : 14 Nov,2024
Instructions:
A. Write a code and you need to run the program and check whether it is working
properly or not. If the program is working properly with different input, write code on
the lined side.
B. Write the output on the blank page in a square box drawn with pencil.
C. All questions need to be written with black pen and code needs to be written with a
blue pen.
D. No whitener, eraser or any other cutting and scratching to be done in Journal. It
should be very neat.
E. Use of Indents and maintaining case sensitivity is mandatory.
F. Fill index properly. Not more than two lines to be used for one question in the index.
Eg: WAP to create a Dictionary using two list
G. Write a minimum 1 appropriate comment in each program.
H. In Journal, don’t write WAP, write the complete statement ‘Write a program’.

1. WAP to check if the entered year is Leap year or not.


2. WAP to scan 3 numbers and print the greatest number.
3. WAP to scan a number and check whether it is Odd, Even or Neutral (Zero)
4. WAP to scan admn, name of student, 5 Subject marks, calculate Total and Average. Print all
the data in the proper format of the report card.
5. WAP to print all the numbers divisible by 7 between two numbers scanned by user.
6. WAP to find Factorial of Number entered by User
7. WAP to display Fibonacci series of N numbers, N entered by User.

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

1. WAP to check if the entered year is Leap year or not.

year = int(input("Enter a year: "))

if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):

print("Leap Year")

else:

print("Not a Leap Year")

2. WAP to scan 3 numbers and print the greatest number.

a = int(input("Enter first number: "))

b = int(input("Enter second number: "))

c = int(input("Enter third number: "))

if a >= b and a >= c:

print("Greatest number:", a)

elif b >= a and b >= c:

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)

num = int(input("Enter a number: "))

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.

admn = input("Enter admission number: ")

name = input("Enter name of student: ")

marks = [int(input(f"Enter marks for subject {i+1}: ")) for i in range(5)]

total = sum(marks)

average = total / 5

print("\nReport Card")

print("Admission No.:", admn)

print("Name:", name)

print("Total Marks:", total)

print("Average Marks:", average)

5. WAP to print all numbers divisible by 7 between two numbers scanned by user.

start = int(input("Enter starting number: "))

end = int(input("Enter ending number: "))

for i in range(start, end+1):

if i % 7 == 0:

print(i, end=" ")

6. WAP to find Factorial of Number entered by User

num = int(input("Enter a number to find its factorial: "))

factorial = 1

for i in range(1, num + 1):

factorial = i

print("Factorial:", factorial)

7. WAP to display Fibonacci series of N numbers

N = int(input("Enter the number of terms in the Fibonacci series: "))

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

8. WAP to print factors of N

N = int(input("Enter a number to find its factors: "))

for i in range(1, N + 1):

if N % i == 0:

print(i, end=" ")

9. WAP to print Armstrong numbers from 1 till N

N = int(input("Enter an upper limit to find Armstrong numbers: "))

for num in range(1, N + 1):

sum_of_cubes = sum(int(digit) 3 for digit in str(num))

if num == sum_of_cubes:

print(num, end=" ")

10. WAP to check if the entered number is Prime or not

num = int(input("Enter a number: "))

is_prime = True

if num <= 1:

is_prime = False

for i in range(2, int(num 0.5) + 1):

if num % i == 0:

is_prime = False

break

print("Prime" if is_prime else "Not Prime")

11. WAP to print prime numbers between two Numbers

start = int(input("Enter starting number: "))

end = int(input("Enter ending number: "))

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

for i in range(2, int(num 0.5) + 1):

if num % i == 0:

is_prime = False

break

if is_prime:

print(num, end=" ")

12. WAP to print HCF and LCM of 2 numbers

a = int(input("Enter first number: "))

b = int(input("Enter second number: "))

hcf = min(a, b)

while hcf > 0:

if a % hcf == 0 and b % hcf == 0:

break

hcf -= 1

lcm = (a b) // hcf

print("HCF:", hcf)

print("LCM:", lcm)

13. WAP to scan N and print table of N

N = int(input("Enter a number to print its table: "))

for i in range(1, 11):

print(f"{N} x {i} = {N i}")

14. WAP to scan N and print Sum of Odd and Sum of Even numbers till N

N = int(input("Enter the limit N: "))

sum_odd = sum(i for i in range(1, N + 1) if i % 2 != 0)

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)

print("Sum of Odd numbers:", sum_odd)

print("Sum of Even numbers:", sum_even)

15. WAP to scan a Number and print the sum of all the digits of the entered number

num = int(input("Enter a number to find the sum of its digits: "))

sum_digits = sum(int(digit) for digit in str(num))

print("Sum of digits:", sum_digits)

python

16. WAP to store sum of odd values and sum of even values in osum and esum variable from 1 to N.

N = int(input("Enter the limit N: "))

osum, esum = 0, 0

for i in range(1, N + 1):

if i % 2 == 0:

esum += i

else:

osum += i

print("Sum of Odd values:", osum)

print("Sum of Even values:", esum)

17. WAP to enter a string and check upper case, lower case, digits, special characters.

string = input("Enter a string: ")

upper, lower, digits, special = 0, 0, 0, 0

for char in string:

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("Upper case letters:", upper)

print("Lower case letters:", lower)

print("Digits:", digits)

print("Special characters:", special)

18. WAP to enter a string, separate all words, and count the number of words.

string = input("Enter a sentence: ")

words = string.split()

print("Separated words:", words)

print("Number of words:", len(words))

19. WAP to enter 10 elements in a list and arrange in descending order without using readymade
method.

elements = [int(input("Enter element: ")) for _ in range(10)]

for i in range(len(elements)):

for j in range(i + 1, len(elements)):

if elements[i] < elements[j]:

elements[i], elements[j] = elements[j], elements[i]

print("Elements in descending order:", elements)

20. WAP to enter a string and check if it's a palindrome.

string = input("Enter a string: ")

if string == string[::-1]:

print("The string is a palindrome.")

else:

print("The string is not a palindrome.")

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.

num = input("Enter a number: ")

if num == num[::-1]:

print("The number is a palindrome.")

else:

print("The number is not a palindrome.")

22. WAP to enter 5 names in a list, add, insert, delete a name, and print the length of each name.

names = [input("Enter a name: ") for _ in range(5)]

new_name = input("Enter a name to add to the list: ")

names.append(new_name)

insert_name = input("Enter a name to insert at position 2: ")

names.insert(1, insert_name)

delete_name = input("Enter a name to delete from the list: ")

if delete_name in names:

names.remove(delete_name)

print("Final names list:", names)

for name in names:

print(f"Length of '{name}': {len(name)}")

23. WAP to merge two lists.

list1 = [int(input("Enter element for list1: ")) for _ in range(5)]

list2 = [int(input("Enter element for list2: ")) for _ in range(5)]

merged_list = list1 + list2

print("Merged list:", merged_list)

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}: ")

marks = [int(input(f"Enter mark {j+1}: ")) for j in range(3)]

students[roll_no] = marks

for roll_no, marks in students.items():

total = sum(marks)

print(f"Roll No: {roll_no}, Marks: {marks}, Total Marks: {total}")

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):

emp_no = input(f"Enter employee number for employee {i+1}: ")

salary = int(input(f"Enter salary for employee {i+1}: "))

employees[emp_no] = salary

max_salary_emp = max(employees, key=employees.get)

min_salary_emp = min(employees, key=employees.get)

print(f"Employee with max salary: Emp No: {max_salary_emp}, Salary: {employees[max_salary_emp]}")

print(f"Employee with min salary: Emp No: {min_salary_emp}, Salary: {employees[min_salary_emp]}")

Delhi Public School – Bopal, Ahmedabad. Informatics Practices. Journal Programs 2024-25 pg. 10

You might also like