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

String Assignment

This document is an assignment for Class XII Computer Science students at Silverline Prestige School, focusing on string manipulation in Python. It includes a list of 19 programming tasks related to strings, such as finding the most frequent character, removing duplicates, and checking for valid email addresses. The assignment is due on April 14, 2025, and carries 0.25 credits.

Uploaded by

Anant Arora
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views14 pages

String Assignment

This document is an assignment for Class XII Computer Science students at Silverline Prestige School, focusing on string manipulation in Python. It includes a list of 19 programming tasks related to strings, such as finding the most frequent character, removing duplicates, and checking for valid email addresses. The assignment is due on April 14, 2025, and carries 0.25 credits.

Uploaded by

Anant Arora
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SILVERLINE PRESTIGE SCHOOL

ASSIGNMENT-1
SUBJECT : COMPUTER SCIENCE(083)
CLASS : XII
SESSION - 2025-26

TOPIC : String and its methods ​ ​ ​ ​


DATE : 8/04/2025​ ​ ​ ​ ​ ​ ​ DATE OF SUBMISSION : 14/04/2025
CREDITS ASSIGNED : 0.25

______________________________________________________________________________

1.​ Write a Python program to find the most frequent character in a string.

2.​ Write a Python program to remove all duplicates from a string and return the
result.
3.​ Write a Python program to count the occurrences of each word in a
sentence.
4.​ Write a Python program to capitalize the first letter of each word in a
sentence.

5.​ Write a Python program to find the longest word in a sentence.


6.​ Write a Python program to check if two strings are anagrams.
7.​ Write a Python program to count the number of occurrences of a specific
substring in a string.

8.​ Write a Python program to find the index of the first occurrence of a
substring in a string.
9.​ Write a Python program to replace all occurrences of a substring with
another substring.

10.​Write a Python program to find the length of the last word in a sentence.
11.​Write a Python program to reverse the order of words in a sentence.

12.​Write a Python program to check if a string is a valid email address.


13.​Write a Python program to check if a string is a valid
URL.
14.​Write a Python program to find the first non-repeated
character in a string.
15.​Write a Python program to remove all leading and
trailing whitespaces from a string.
16.​Write a Python program to find the common characters
between two strings.

17.​Write a Python program to find the second most frequent


character in a string.
18.​Write a Python program to check if a string contains
only unique characters.
19.​Write a Python program to find the longest common prefix
among a list of strings.

You might also like