What is the output of the following code? >>> a=(1,2,3,4)
>>> del(a[2])
a) Now, a=(1,2,4)
b) Now, a=(1,3,4)
c) Now a=(3,4)
d) Error as tuple is immutable

1 Answer

Answer :

d) Error as tuple is immutable

Related questions

Description : Is the following piece of code valid? >>> a=(1,2,3,4) >>> del a a) No because tuple is immutable b) Yes, first element in the tuple is deleted c) Yes, the entire tuple is deleted

Last Answer : c) Yes, the entire tuple is deleted

Description : If a=(1,2,3,4), a[1:-1] is a) Error, tuple slicing doesn’t exist b) [2,3]. c) (2,3,4) d) (2,3)

Last Answer : d) (2,3)

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} a.setdefault(4,"D") print(a) a) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}. b) None. c) Error.

Last Answer : a) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}.

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} print(a.get(5,4)) a) Error, invalid syntax b) A c) 5 d) 4

Last Answer : d) 4

Description : What is the output when following code is executed ? >>>list1 = [11, 2, 23] >>>list2 = [11, 2, 2] >>>list1 < list2 is a) True b) False c) Error d) None

Last Answer : b) False

Description : What is the output when following code is executed ? >>>names = ['Amir', 'Bear', 'Charlton', 'Daman'] >>>print(names[-1][-1]) a) A b) Daman c) Error d) n

Last Answer : b) Daman

Description : hat is the output when following code is executed ? >>>print r"\nhello" The output is a) a new line and hello b) \nhello c) the letter r and then hello d) error

Last Answer : d) error

Description : A .................. normal form normalization will be needed where all attributes in a relation tuple are not functionally dependent only on the key attribute. A) First B) Second C) Third D) Fourth

Last Answer : C) Third

Description : In a relational schema, each tuple is divided into fields called A) Relations B) Domains C) Queries D) All of the above

Last Answer : B) Domains

Description : A set of possible data values is called (A) attribute. (B) degree. (C) tuple. (D) domain.

Last Answer : D) domain.

Description : The RDBMS terminology for a row is (A) tuple. (B) relation. (C) attribute. (D) degree.

Last Answer : (A) tuple

Description : A relational database developer refers to a record as (A) a criteria. (B) a relation. (C) a tuple. (D) an attribute.

Last Answer : C) a tuple

Description : What is the data type of (1)? a) Tuple b) Integer c) List d) Both tuple and integer

Last Answer : b) Integer

Description : Which of the following is a Python tuple? a) [1, 2, 3]. b) (1, 2, 3) c) {1, 2, 3} d) {}

Last Answer : b) (1, 2, 3)

Description : 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.

Last Answer : (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL.

Description : Which command is used to remove a file? A. remove B. rm C. mv D. del E. None of the above

Last Answer : B. rm

Description : If you are to use [Control-c] as the interrupt key instead of [Del], then you will have to use A. tty ^c B. stty intr \^c C. stty echoe D. stty echo \^a E. None of the above

Last Answer : B. stty intr \^c

Description : Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use a) d.delete(“john”:40) b) d.delete(“john”) c) del d[“john”]. d) del d(“john”:40)

Last Answer : c) del d[“john”].

Description : What will be the output? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2 a) True b) False c) Error d) None

Last Answer : c) Error

Description : What will be the output? d1 = {"john":40, "peter":45} Page No 40 d2 = {"john":466, "peter":45} d1 == d2 a) True b) False c) None d) Error

Last Answer : b) False

Description : What will be the output? d = {"john":40, "peter":45} "john" in d a) True b) False c) None d) Error

Last Answer : a) True

Description : What will be the output? >>>my_tuple = (1, 2, 3, 4) >>>my_tuple.append( (5, 6, 7) ) >>>print len(my_tuple) a) 1 b) 2 c) 5 d) Error

Last Answer : c) 5

Description : What will be the output? >>>t1 = (1, 2, 4, 3) >>>t2 = (1, 2, 3, 4) >>>t1 < t2 a) True b) False c) Error d) None

Last Answer : b) False

Description : What is the output of the following? print("xyyzxyzxzxyy".count('xyy', -10, -1)) a) 2 b) 0 c) 1 d) error

Last Answer : b) 0

Description : What is the output of the following? print("xyyzxyzxzxyy".count('xyy', 2, 11)) a) 2 b) 0 c) 1 d) error

Last Answer : b) 0

Description : What is the output of the following? print("xyyzxyzxzxyy".count('xyy', 0, 100)) a) 2 b) 0 c) 1 d) error

Last Answer : a) 2

Description : What is the output of the following? print("xyyzxyzxzxyy".count('yy')) a) 2 b) 0 Page No 23 c) error d) none of the mentioned

Last Answer : a) 2

Description : What is the output when following statement is executed ? >>> print(‘x\97\x98’) a) Error b) 97 98 c) x\97 d) \x97\x98

Last Answer : c) x\97

Description : What is the output when following statement is executed ? >>>print('new' 'line') a) Error b) Output equivalent to print ‘new\nline’ Page No 22 c) newline d) new line

Last Answer : c) newline

Description : What is the output of the following? x = 123 for i in x: print(i) a) 1 2 3 b) 123 c) error d) none of the mentioned

Last Answer : c) error

Description : What is the output of the following? x = 'abcd' for i in range(len(x)): i.upper() print (x) a) a b c d b) 0 1 2 3 c) error d) none of the mentioned

Last Answer : c) error

Description : What is the output of the following? x = 'abcd' for i in x: print(i.upper()) a) a b c d b) A B C D c) a B C D d) error

Last Answer : b) A B C D

Description : What is the output of the following? x = "abcdef" while i in x: print(i, end=" ") a) a b c d e f b) abcdef c) i i i i i i … d) error

Last Answer : d) error

Description : What is the output of the following? i = 0 while i < 3: Page No 15 print(i) i += 1 else: print(0) a) 0 1 2 3 0 b) 0 1 2 0 c) 0 1 2 d) error

Last Answer : b) 0 1 2 0

Description : What is the output of the following? i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0) a) 0 1 2 0 b) 0 1 2 c) error d) none of the mentioned

Last Answer : b) 0 1 2

Description : What is the output of the following? i = 2 while True: if i%3 == 0: break print(i) i += 2 a) 2 4 6 8 10 … b) 2 4 c) 2 3 d) error

Last Answer : b) 2 4

Description : What is the output of the following? i = 5 while True: if i%0O9 == 0: break print(i) i += 1 a) 5 6 7 8 b) 5 6 7 8 9 c) 5 6 7 8 9 10 11 12 13 14 15 …. d) error

Last Answer : d) error

Description : hat is the output of the following? i = 5 while True: if i%0O11 == 0: Page No 12 break print(i) i += 1 a) 5 6 7 8 9 10 b) 5 6 7 8 c) 5 6 d) error

Last Answer : b) 5 6 7 8

Description : What is the output of the following? i = 1 while True: if i%0O7 == 0: break print(i) i += 1 a) 1 2 3 4 5 6 b) 1 2 3 4 5 6 7 c) error d) none of the mentioned

Last Answer : a) 1 2 3 4 5 6

Description : What is the output of the following? i = 1 Page No 11 while True: if i%3 == 0: break print(i) i + = 1 a) 1 2 b) 1 2 3 c) error d) none of the mentioned

Last Answer : c) error

Description : What will be the output of the following segment of the program? main( ) { char *s = “hello world”; int i = 7; printf(“%, *s”, i, s); } (A) Syntax error (B) hello w (C) hello (D) o world

Last Answer : Answer: Marks given to all

Description : Which one of the following is not a definition of error ? (A) It refers to the discrepancy between a computed, observed or measured value and the true, specified or theoretically correct value. (B) It ... to fail. (D) It refers to human action that results in software containing a defect or fault. 

Last Answer : The input, or clock pulse.

Description : What is the output of the following program ? (Assume that the appropriate pre-processor directives are included and there is no syntax error) main() { char S[ ] = "ABCDEFGH"; printf ("%C",* (& ... Base address of S is 1000 */ } (A) ABCDEFGH1000 (B) CDEFGH1000 (C) DDEFGHH1000 (D) DEFGH1000

Last Answer : (D) DEFGH1000

Description : Covert the output of Zip() from tuple to list in Python -Web-Development

Last Answer : answer:

Description : Match the following HTTP status code to their respective definitions. i) 400 a) OK ii) 500 b) Not found iii) 200 c) Continue iv) 100 d) Internal server error A) i-b, ii-d, iii-a, iv-c B) i-a, ii-b, iii-c, iv-d C) i-b, ii-c, iii-a, iv-d D) i-b, ii-a, iii-c, iv-d

Last Answer : A) i-b, ii-d, iii-a, iv-c

Description : Match the following HTTP status code to their respective definitions. i) 400 a) OK ii) 500 b) Not found iii) 200 c) Continue iv) 100 d) Internal server error A) i-b, ii-d, iii-a, iv-c B) i-a, ii-b, iii-c, iv-d C) i-b, ii-c, iii-a, iv-d D) i-b, ii-a, iii-c, iv-d

Last Answer : A) i-b, ii-d, iii-a, iv-c

Description : A t-error correcting q-nary linear code must satisfy:  Where M is the number of code words and X is (1) qn (2) qt (3) q-n (4) q-t

Last Answer : (1) qn 

Description : Let C be a binary linear code with minimum distance 2t + 1 then it can correct upto ............bits of error. (1) t + 1 (2) t (3) t - 2 (4) t/2

Last Answer : (2) t