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

Python 9

The document contains Python programming tasks that involve checking for palindromes, finding strings with a specific prefix, and determining the lengths of strings in a list. It provides input examples and expected output for each task. The tasks are designed to test string manipulation and list handling in Python.

Uploaded by

rrs_1988
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)
52 views1 page

Python 9

The document contains Python programming tasks that involve checking for palindromes, finding strings with a specific prefix, and determining the lengths of strings in a list. It provides input examples and expected output for each task. The tasks are designed to test string manipulation and list handling in Python.

Uploaded by

rrs_1988
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
You are on page 1/ 1

Write a Python program to check whether the given strings are palindromes or

not. Return True, False. Go to the editor


Input:
['palindrome', 'madamimadam', '', 'foo', 'eyes']
Output:
[False, True, True, False, False]
Click me to see the sample solution

13. Write a Python program to find the strings in a given list, starting with a
given prefix. Go to the editor
Input:
[( ca,('cat', 'car', 'fear', 'center'))]
Output:
['cat', 'car']
Input:
[(do,('cat', 'dog', 'shatter', 'donut', 'at', 'todo'))]
Output:
['dog', 'donut']
Click me to see the sample solution

14. Write a Python program to find the lengths of a given list of non-empty


strings. Go to the editor
Input:
['cat', 'car', 'fear', 'center']
Output:
[3, 3, 4, 6]
Input:
['cat', 'dog', 'shatter', 'donut', 'at', 'todo', '']
Output:
[3, 3, 7, 5, 2, 4, 0]

You might also like