Programs on Python Strings
Class-11
Q1.
Write Python script to input a string and a character and count the number of
occurrences of the character in the string.
Q2.
Write Python script to input a string and display it in reverse order.
Q3.
Write Python script to input a string and check whether it is a palindrome or
not.
Q4.
Write Python script to input a string and count the number of words in it.
Q5.
Write Python script to input a string and count the number of words beginning
with ‘A; or ‘a’.
Q6.
Write Python script to input a string and replace the first letter of every
word to uppercase and then display it.
Q7.
Write Python script to input a string and replace all occurrences of the word
‘the’ with ‘that’.
Q8.
Write Python script to input a string and count and display the number of
capital alphabets, small alphabets and numbers.
Q9. Write a program to read a line of strings and count total no. of uppercase and lowercase characters.
Q10. Write program to input the line of strings and replace each uppercase alphabet with '*' symbol and each lowercase character with '@'
No comments:
Post a Comment