Class Xi A - Cs Holiday Homework
Class Xi A - Cs Holiday Homework
HOLIDAY HOMEWORK
SUB: COMPUTER SCIENCE
CLASS :XI A
The exercises cover fundamental Python concepts such as loops, conditionals, strings, and list.
3. Even Numbers Between a Range Write a Python program to print all even numbers
between 1 and 50.
4. Swapping Two Numbers Write a program to swap the values of two variables without
using a third variable.
5. Leap Year Check: Write a program to check if a given year is a leap year.
2. Conditional Statements
1. Check Odd or Even Write a program to check whether a number entered by the user is
odd or even.
2. Largest of Three Numbers Write a Python program to input three numbers and print
the largest of the three.
3. Grading System Input a student’s percentage and display their grade based on the
following:
• 90% and above: A
• 80% - 89%: B
• 70% - 79%: C
• 60% - 69%: D
• Below 60%: Fail
3. Loops
1. Print Natural Numbers Write a program to print the first 20 natural numbers using a for
loop.
2. Multiplication Table Write a Python program to display the multiplication table of any
number entered by the user.
5. Prime Number Check Write a Python program to check if a number entered by the
user is a prime number.
* *
* * *
* * * *
* * * * *
4. Strings
1. Palindrome Check Write a program to check if a given string is a palindrome (reads the
same forward and backward).
2. Count Vowels and Consonants Write a Python program to count the number of vowels
and consonants in a given string.
3. Word Count Write a Python program to count the number of words in a sentence
entered by the user.
4. Reverse a String Write a program to reverse a string without using built-in functions
5. Lists
1. Find the Largest Element Write a program to input a list of numbers and find the
largest element in the list.
2. List Reversal Write a Python program to reverse a list without using the built-in
reverse() method.
3. Sum of List Elements Write a program to calculate the sum of all the elements in a list.
4. Fibonacci Series: Write a program to generate the first n terms of the Fibonacci
series.
5. Check Prime Number: Write a program to check if a given number is a prime number.
**************************