Example HTML page

P-Assignment 8: Strings

Hi,

Please do the following programs.

Mode: Easy

1. Write a python script that read a string from the user and print only the even indexed position characters in that string.
2. Write a python script that read a string from the user and print only the odd indexed position characters in that string.
3. Write a python script to maximum element in a given string.
4. Write a python script to print the characters in reverse order in a given string.
5. Write a python script to count the number of vowels and number of consonants in a given string.
6. Write a python script to print the sum of vowels count and consonants count in a given string.
7. Write a python script to remove the Special charecters in the following strings.
a. $$$$$$$$ Hello Sudhakar
b. Hello Sudhakar &&&&&&&&&&&
c. $$$$$$$$$$$ Hello Sudhakar $$$$$$$$$$
8. Write a python script to check display the larger string from the given two strings.
9. Write a python script to check the length of the given strings are equal or not.
10. Write a python script to check two given strings are anagrams or not. Note: Two strings are said to be anagrams if we sort the two strings, both give the same order of elements. For example: silent, listen both are anagrams.
11. Write a python script to check whether first string is present in second string or not. for example:
s1 = “python” , S2 = “Hello Sudhakar !, This is python programming”. s1 is present in S2.
12. write a python script to convert the string in to a list.
13. Write a python script to ask the user to enter the First_Name, Middle_Name and Last_Name. Print the full name of the user.
14. Write a python script to print the characters other than vowels in a given string. For example if the string is “Sudhakar”, it should print S,d,h,k,r
15. Write a python script to replace all the vowels in a given string with “*”. For example if the given string is “Sudhakar”, the output should be “S*dh*k*r”.
16. Write a python script to split the given string in to words. For example, if the given string is ” Hello Sudhakar Welecome to the python programming”, the output should be
Hello
Sudhakar
Welcome
to
the
python
programming
17. Write a python script to encode and decode the given string.
18. Write a python script to check whether the given string is ends with ‘r’. If it is not ends with ‘r’, then append the ‘r’ at the end of the string and print it.
19.Write a python script to check whether the given string is starts with ‘r’. If it is not ends with ‘r’, then append the ‘r’ at the starting of the string and print it.
20. Write a python script to print the index positions of ‘i’ in a given string. For example, “This is india”. ‘i’ is at 2,5,8,11.

Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest