0% found this document useful (0 votes)
1 views1 page

Python String Tasks Basic Intermediate

The document outlines Python string practice tasks categorized into basic and intermediate levels. Basic tasks include string length, case conversion, character frequency, string reversal, and palindrome checking. Intermediate tasks involve removing vowels, counting words, replacing words, finding the longest word, and extracting digits.

Uploaded by

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

Python String Tasks Basic Intermediate

The document outlines Python string practice tasks categorized into basic and intermediate levels. Basic tasks include string length, case conversion, character frequency, string reversal, and palindrome checking. Intermediate tasks involve removing vowels, counting words, replacing words, finding the longest word, and extracting digits.

Uploaded by

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

Python String Practice Tasks

Basic Level Tasks

1. String Length: Given a string, print its length.

2. Case Conversion: Convert a string to uppercase, lowercase, and title case.

3. Character Frequency: Count how many times a specific character appears in a string.

4. Reverse a String: Reverse a string using slicing and using a loop.

5. Check Palindrome: Check whether a string is a palindrome (ignore case).

Intermediate Level Tasks

6. Remove Vowels: Remove all vowels from a given string.

7. Count Words: Count how many words are in a sentence.

8. Replace Words: Replace all occurrences of one word with another word in a sentence.

9. Find Longest Word: Given a sentence, find the longest word.

10. Extract Digits: Extract only numeric characters from a string and print them as a new string.

You might also like