The program is written in Python and it counts the number of occurrences of an element in a tuple. The program creates a tuple t containing 7 elements (30, 50, 10, 30, 70, 50, 30). The program then uses the count() method on the tuple t to count the number of occurrences of the value 30 in the tuple. The result is then printed using the print() function.
t = (30, 50, 10, 30, 70, 50, 30) print("Number of Counts 30 :",t.count(30))
Number of Counts 30 : 3
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions