Write a program to check if the letter 'e' is present in the word 'Umbrella'.
print'e'in'Umbrella'
5.
Write a program to check if the word 'orange' is present in the "This is orange juice".
a="This is orange juice"print'orange'ina.split()
6.
Write a program to find the first and the last occurence of the letter 'o' and character ',' in "Hello, World".
Run a loop from front and one from back.
7.
Write a program that takes your full name as input and displays the abbreviations of the first and middle names except the last name which is displayed as it is. For example, if your name is Robert Brett Roser, then the output should be R.B.Roser.
Check the occurrence of the letter 'e' and the word 'is' in the sentence "This is umbrella".
9.
Write a program to find the number of vowels, consonents, digits and white space characters in a string.
10.
Write a program to make a new string with all the consonents deleted from the string "Hello, have a good day".
a=['a','e','i','o','u','A','E','I','O','U',' ']b="Hello, have a good day"foriinb:ifinotina:b=b[:b.index(i)]+b[b.index(i)+1:]printb
Level 2
1.
Write a program to find out the largest and smallest word in the string "This is an umbrella".
a="This is an umbrella"a=a.split()maxx=a[0]max_len=len(a[0])foriina:iflen(i)>max_len:max_len=len(i)maxx=iprintmaxx#similarly find minimum
2.
Write a program to check if a given string is a Palindrome. A palindrome reads same from front and back e.g.- aba, ccaacc, mom, etc.
a=raw_input()#a[:] will give the whole stringprinta[:]#a[::-1] -1 is step. It will reverse the stringprinta[::-1]printa==a[::-1]#There are lot of other ways to solve this problem
3.
Write down the names of 10 of your friends in a list and then sort those in alphabetically ascending order.
Do it yourself
4.
Write a program to make a new string with the word "the" deleted in the sentence "This is the lion in the cage".
a="This is the lion in the cage"a=a.split()foriina:ifi=="the":#a.index(i) will give the index of i in adel(a[a.index(i)])printaprint" ".join(a)
5.
Write a program to check if the two strings entered by user are anagrams or not. Two words are said to be anagrams if the letters of one word can be rearranged to form the other word. For example, jaxa and ajax are anagrams of each other.
Store every character of the strings in two list and then compare the list