2013 21 122 Strings
2013 21 122 Strings
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.