मराठी

Consider the following tuples, tuple1 and tuple2: tuple1 = (23,1,45,67,45,9,55,45) tuple2 = (100,200) Find the output of the following statement: print(tuple1.count(45))

Advertisements
Advertisements

प्रश्न

Consider the following tuples, tuple1 and tuple2:

tuple1 = (23,1,45,67,45,9,55,45)
tuple2 = (100,200)

Find the output of the following statement:

print(tuple1.count(45))
टीपा लिहा
Advertisements

उत्तर

The 'count()' function returns the number of times the given element appears in the tuple.

OUTPUT: 3

shaalaa.com
Tuple Methods and Built-in Functions
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 10: Tuples and Dictionaries - Exercise [पृष्ठ २२३]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
पाठ 10 Tuples and Dictionaries
Exercise | Q 1. ii. | पृष्ठ २२३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×