What is the output of the following? print("xyyzxyzxzxyy".count('yy', 1)) a) 2  b) 0  c) 1  d) none of the mentioned

1 Answer

Answer :

a) 2

Related questions

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

Last Answer : c)

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 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? d = {0: 'a', 1: 'b', 2: 'c'} for i in d: print(i) Page No 18 a) 0 1 2 b) a b c c) 0 a 1 b 2 c d) none of the mentioned

Last Answer : a) 0 1 2

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? 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 = 1 while False: if i%2 == 0: break print(i) i += 2 a) 1 b) 1 3 5 7 … c) 1 2 3 4 … d) none of the mentioned

Last Answer : d) none of the mentioned

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 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)): print(x) x = 'a' a) a b) abcd abcd abcd abcd c) a a a a d) none of the mentioned

Last Answer : d) none of the mentioned

Description : What is the output of the following? x = 'abcd' for i in range(len(x)): x = 'a' print(x) Page No 17 a) a b) abcd abcd abcd c) a a a a d) none of the mentioned

Last Answer : c) a a a a

Description : What is the output of the following? True = False while True: print(True) break a) True b) False c) None d) none of the mentioned

Last Answer : b) False

Description : What is the output of the following? x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x) a) [‘AB’, ‘CD’]. b) [‘ab’, ‘cd’, ‘AB’, ‘CD’]. c) [‘ab’, ‘cd’]. d) none of the mentioned

Last Answer : d) none of the mentioned

Description : What is the output of the following? x = ['ab', 'cd'] for i in x: i.upper() print(x) a) [‘ab’, ‘cd’]. b) [‘AB’, ‘CD’]. c) [None, None]. d) none of the mentioned

Last Answer : a) [‘ab’, ‘cd’].

Description : Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], which of the following is correct syntax for slicing operation? a) print(list1[0]) b) print(list1[:2]) c) print(list1[:-2]) d) all of the mentioned

Last Answer : d) all of the mentioned

Description : What will be the output? numberGames = {} numberGames[(1,2,4)] = 8 numberGames[(4,2,1)] = 10 numberGames[(1,2)] = 12 sum = 0 for k in numberGames: sum += numberGames[k] print len(numberGames) + sum Page No 36 a) 30 b) 24 c) 33 d) 12

Last Answer : a) 30

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

Last Answer : d) 22

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 = 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 = 1 while True: if i%2 == 0: break print(i) i += 2 a) 1 Page No 13 b) 1 2 c) 1 2 3 4 5 6 … d) 1 3 5 7 9 11 …

Last Answer : d) 1 3 5 7 9 11 …

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 code? a={1:"A",2:"B",3:"C"} a.clear() print(a) a) None b) { None:None, None:None, None:None} c) {1:None, 2:None, 3:None} d) { }

Last Answer : d) { }

Description : 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’}

Last Answer : c) {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}

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.setdefault(3)) a) {1: ‘A’, 2: ‘B’, 3: ‘C’} b) C c) {1: 3, 2: 3, 3: 3} d) No method called setdefault() exists for dictionary

Last Answer : b) C

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 of the following piece of code? a={1:"A",2:"B",3:"C"} print(a.get(1,4)) a) 1 b) A c) 4

Last Answer : b) A

Description : What is the output of the following code? a={1:"A",2:"B",3:"C"} for i,j in a.items(): print(i,j,end=" ") a) 1 A 2 B 3 C b) 1 2 3 c) A B C d) 1:”A” 2:”B” 3:”C”

Last Answer : a) 1 A 2 B 3 C

Description : What will be the output? d = {"john":40, "peter":45} print(list(d.keys())) a) [“john”, “peter”]. b) [“john”:40, “peter”:45]. c) (“john”, “peter”) d) (“john”:40, “peter”:45)

Last Answer : a) [“john”, “peter”].

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 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 : 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 : 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 : 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" i = "i" while i in x: print(i, end=" ") a) no output b) i i i i i i … c) a b c d e f

Last Answer : a) no output

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 : How can applescript be used to insert a YY.MM.DD date stamp?

Last Answer : answer:Here is a quick and dirty that will post the date to the clipboard. It will notify you first so it so you don't accidentally overwrite what is on the clipboard. Just hit enter and it is on your ... want. But it is a start and I am drunk and tired and haven't touched applescript in a while.

Description : 23 Write a letter to the principal applying for the post of post graduate teacher in English. write XXX for your name and YY for your address with full Blo-Data.

Last Answer : 23 Write a letter to the principal applying for the post of post graduate teacher in English. write ... and YY for your address with full Blo-Data.

Description : In a certain plant yellow leaves are dominant (Y) and red leaves are recessive (y). A plant with genotype Yy and a plant with Yy are crossed.?

Last Answer : What is the answer ?

Description : In Mendel's experiments with garden pea, round seed shape (RR) was dominant over wrinkled seeds (rr), yellow cotyledon (YY) was dominant over green cotyledon (yy). What are the ... green cotyledons (c) Only wrinkled seeds with yellow cotyledons (d) Only wrinkled seeds with green cotyledons

Last Answer : (d) Only wrinkled seeds with green cotyledons

Description : Which command is used to count just the number of characters in a file? A. wc - 1 B. wc -c C. wc -w D. wc -r E. None of the above

Last Answer : B. wc -c

Description : Which command sends the word count of the file infile to the newfile. A. wc infile >newfile B. wc newfile C. wc infile - newfile D. wc infile | newfile E. None of the above

Last Answer : A. wc infile >newfile

Description : What is the function of following UNIX command? WC - lb& (A) It runs the word count program to count the number of lines in its input, a, writing the result to b, as a foreground process. (B) It runs ... (D) It copies the l ' numbers of lines of program from file, a, and stores in file b.

Last Answer : (B) It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background.

Description : Consider a database table R with attributes A and B. Which of the following SQL queries is illegal ? (A) SELECT A FROM R; (B) SELECT A, COUNT(*) FROM R; (C) SELECT A, COUNT(*) FROM R GROUP BY A; (D) SELECT A, B, COUNT(*) FROM R GROUP BY A, B;

Last Answer : (B) SELECT A, COUNT(*) FROM R;