0% found this document useful (0 votes)
6 views23 pages

2013 21 122 Strings

Uploaded by

hashimkp7
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)
6 views23 pages

2013 21 122 Strings

Uploaded by

hashimkp7
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
You are on page 1/ 23

Module 2

STRINGS
- A sequence of characters enclosed within single quotes or double quotes
- Strings are immutable

Functions:
len()
min()
max()
endswith()
startswith()
join()
1) Program to reverse a string
2) Program to count the number of alphabets, digits and special symbols in a sentence.
3) Program to reverse each word in a sentence.
4) Write a python program to accept a file name from the user and print extension of that.
5) Write a python program to create a single string separated with space from two strings
by swapping the character at position 1.
6) Write a python program to get a string from an input string where all occurrences of the
first character are replaced with ‘$’, except the first character.[eg: onion -> oni$n]
7) Write a python program to count the occurrences of each word in a line of text.
8) Program to count the no.of occurrences of each character in a string.
9) Write a python program to form a list of vowels selected from a given word using List
comprehensions.

You might also like