0% found this document useful (0 votes)
6 views4 pages

Python String and List Exercises

The document outlines various programming tasks related to Python strings and lists, including creating functions for palindrome checking, vowel counting, case swapping, word reversing, and character frequency. It also includes tasks for list operations such as calculating sum and average, removing duplicates, finding max/min values, filtering even numbers, and identifying the second largest number. Additionally, there is a mention of Python dictionary list operations.

Uploaded by

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

Python String and List Exercises

The document outlines various programming tasks related to Python strings and lists, including creating functions for palindrome checking, vowel counting, case swapping, word reversing, and character frequency. It also includes tasks for list operations such as calculating sum and average, removing duplicates, finding max/min values, filtering even numbers, and identifying the second largest number. Additionally, there is a mention of Python dictionary list operations.

Uploaded by

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

Questions on Python Strings

1. Palindrome Checker: Write a program to check if a string is a


palindrome (reads the same forward and backward).

2. Vowel Counter: Create a function that counts the number of


vowels in a given string.

3. Case Swapper: Write a program that takes a string and converts


all uppercase letters to lowercase and vice versa.

4. Word Reverser: Given a sentence, reverse the order of the words.

5. Character Frequency: Count how many times each character


appears in a string.

Solutions
Questions on Python Lists

1. Sum and Average: Write a program to find the sum and average
of all numbers in a list.

2. Remove Duplicates: Given a list with repeating elements, create a


new list with only unique values.

3. Find Max/Min: Without using built-in max() or min(), find the


largest and smallest numbers in a list.

4. List Filtering: Given a list of integers, create a new list containing


only the even numbers.

5. Second Largest: Find the second largest number in a list.


gdsh
Python Dictionary List Operations

You might also like