हिंदी

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(sum(tuple2))

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(sum(tuple2))
टिप्पणी लिखिए
Advertisements

उत्तर

The 'sum()' function returns the sum of all the elements of the tuple.

OUTPUT:
300

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. vii. | पृष्ठ २२४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×