🔍
What is the output of the following code? >>> a=(2,3,4)  >>> sum(a,3)  a) Too many arguments for sum() method b) The method sum() doesn’t exist for tuples c) 12  d) 9
0 like 0 dislike

1 Answer

c) 12
0 like 0 dislike

Related questions

What is the output of the following code? a={1:"A",2:"B",3:"C"} b={4:"D",5:"E"} a.update(b) print(a) a) {1: ‘A’, 2: ‘B’, 3: ‘C’} b) Method update() doesn’t exist for dictionaries c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’} d) {4: ‘D’, 5: ‘E’}
Answer : c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}...

View solution
0 like 0 dislike
1 answer

What is the output when following code is executed ? names1 = ['Amir', 'Bear', 'Charlton', 'Daman'] names2 = names1 names3 = names1[:] names2[0] = 'Alice' names3[1] = 'Bob' sum = 0 for ls in (names1, names2, names3): ... if ls[1] == 'Bob': sum += 10 print sum a) 11 b) 12 c) 21 d) 22
Answer : d) 22...

View solution
0 like 0 dislike
1 answer

What is the output of the following piece of code when executed in Python shell? >>> a=("Check")*3 >>> a a) (‘Check’,’Check’,’Check’) b) * Operator not valid for tuples c) (‘CheckCheckCheck’) d) Syntax erro
Answer : c) (‘CheckCheckCheck’)...

View solution
0 like 0 dislike
1 answer

In a relational database model, NULL values can be used for all but which one of the following? (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL. (B) To ... D) To fill a column in a tuple when that column does not really exist for that particular tuple.
Answer : (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL....

View solution
0 like 0 dislike
1 answer

50.5k questions

47.1k answers

240 comments

7.0k users