def reverse_string_slicing(s):
"""Reverses a string using slicing."""
return s[::-1]
# Example usage
input_string = "hello"
reversed_string = reverse_string_slicing(input_string)
print(f"Original: {input_string}, Reversed: {reversed_string}")
from collections import Counter
s = "Python is Fun!"
v = "aeiouAEIOU"
cnt = Counter([i for i in s if i in v])
print(cnt)
my_list = [1, 2, 3, 1, 4, 2, 1, 5]
item_to_count = 1
count = my_list.count(item_to_count)
print(f"The item {item_to_count} appears {count} times in the list.")
కామెంట్లు లేవు:
కామెంట్ను పోస్ట్ చేయండి