Python | Split String Reverse

Summary: There are three different ways to split the string and reverse it:🍎Using reversed() and join()🍎Using list slicing🍎Using numpy.flip() Minimal Example Problem Formulation 📜Problem: Given a string. How will you take a string, split it, reverse it and join it back together again using Python? Example: Let’s visualize the problem with the help of an … Read more

How to Count the Number of Unique Values in a List in Python?

Problem Statement: Consider that you have been given a list in Python. How will you count the number of unique values in the list? Example: Let’s visualize the problem with the help of an example: Given: li = [‘a’, ‘a’, ‘b’, ‘c’, ‘b’, ‘d’, ‘d’, ‘a’]Output: The unique values in the given list are ‘a’, ‘b’, ‘c’, ‘d’. … Read more