Given a list of strings, write a Python program to convert all string from lowercase/uppercase to uppercase/lowercase.
Input : ['GeEk', 'FOR', 'gEEKS'] Output: ['geeks', 'for', 'geeks'] Input : ['fun', 'Foo', 'BaR'] Output: ['FUN', 'FOO', 'BAR']
Method #1 : Convert Uppercase to Lowercase using map
function
|
['geek', 'for', 'geeks']
Method #2: Convert Lowercase to Uppercase using List comprehension
|
['FUN', 'FOO', 'BAR']
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the “Improve Article” button below.
thumb_up
Be the First to upvote.
Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.