0% found this document useful (0 votes)
21 views

Strings

Uploaded by

dchavan0853
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Strings

Uploaded by

dchavan0853
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Write a program to check if the given string is Palindrome or not with and without

using reversed method.


Replace "how" to "who" in the string "hi how are you" with and without inbuilt
methods
Replace all the vowels with "*" in the string "hello world"
Replace all the characters which occurs more than once with "*" in the string
"hello world"
Write a Python program to accept a filename from the user and print the extension
of that.
Sample filename : abc.java
Output : java"
convert a string to a list and vice-versa.
Covert the string "Hello welcome to Python" to a comma separated string.
Write a Program to print ascii values of the characters present in a string.
Find the longest word in the sentence
sentence = Hello world. Welcome to Python"
Sum all the numbers in the below string.
s = "Sony12India567Pvt2ltd"
Program to print the number of occurrences of characters in a String without using
inbuilt functions.
s = 'helloworld'
Program to print only the repeated characters and count of the same.
s = 'helloworld'
Write a program to get alternate characters of a string
Find the longest non-repeated substring in the below string
s = "This is a Programming language and Programming is fun"
Write a program to count the number of white spaces in a given string
Write a program to rotate characters in a string
Write a program to print only non-repeated characters in a string
Write a program to print all the consonants in a given string
Write a program to count no of capital letters in a string
Write a program to find the first repeating character in a string
Write a program to find the index of nth occurrence of a sub-string in a string
>>> sentence = "hello world welcome to python hello hi how are you hello there"

Write a program to count the number of occurrences of non-special characters in a


given string
>>> s = 'hello@world! welcome!!! Python$ hi how are you & where are you?'

Filter only those characters except digits


s = '@hello12world34welcome!123'

Find all max length words from the below sentence


>>> sentence = "hello world hi apple you yahoo to you"

You might also like