Computer Science
Write a script to partition the string 'INSTITUTE' at the occurrence of letter 'T'.
Python
Python String Manipulation
4 Likes
Answer
string = 'INSTITUTE'
parts = string.partition('T')
print(parts)Output
('INS', 'T', 'ITUTE')
Answered By
2 Likes
Related Questions
Write a program to convert a string with more than one word into titlecase string where string is passed as parameter. (Titlecase means that the first letter of each word is capitalized.)
Write a program that takes a sentence as an input parameter where each word in the sentence is separated by a space. The function should replace each blank with a hyphen and then return the modified sentence.
What will be the output of the following programming code?
str = "My Python Programming" print (str[-5:-1]) print (str[1:5]) print (str[:-4]) print (str[0:]) print (str[:13-4]) print (str[:3])Write a program to count the number of each vowel in a given string.