Strings: Indexing, slicing, split(), strip(), find(), replace(), formatting using f-strings
- Write a Python program to extract characters from index 2 to index 6 using string slicing ?
- Write a Python program to count how many vowels are present at even index positions using indexing ?
- Write a Python program to access and display the first and last characters of a string using string indexing ?
- Write a Python program to extract a substring from a given string using string slicing ?
- Write a Python program to split a sentence into individual words using the split() method ?
- Write a Python program to remove leading and trailing spaces from a string using the strip() method ?
- Write a Python program to find the position of a word in a string using the find() method ?
- Write a Python program to replace a word in a string using the replace() method ?
- Write a Python program to display student information using f-string formatting ?
- Write a Python program to reverse a string using slicing ?
- Write a Python program to extract the domain name from an email address using string slicing and find() ?
- Write a Python program to count the number of words in a sentence using split() ?
- Write a Python program to mask a mobile number except for the last four digits using string slicing ?
- Write a Python program to convert a comma-separated string into a list and display each item separately ?
- Write a Python program to generate a formatted employee ID card using f-strings ?
- Write a Python program to remove multiple unwanted characters (#, @, *) from both ends of a string using strip() ?
- Write a Python program to replace multiple spaces in a sentence with a single space using string methods ?
- Write a Python program to generate a username from a full name by extracting initials and formatting them using string methods ?
- Write a Python program to check whether the first three characters and last three characters of a string are the same using slicing ?
- Write a Python program to replace underscores (_) in a username with spaces using the replace() method.