π (Class Date: 5th Aug | Posted on: 7th Aug)
Today I practiced some basic Python logic problems:
β
Reverse a string
β
Remove duplicates from a list
python
Copy code
Reverse a string
text = "DataAnalytics"
reversed_text = text[::-1]
print("Reversed String:", reversed_text)
Remove duplicate values from a list
my_list = [1, 2, 2, 3, 4, 4, 5]
unique_list = list(set(my_list))
print("List without duplicates:", unique_list)
These simple programs help build a strong base in Python for data analytics.
Consistency is the key! π
Top comments (0)