Similar Collections


    No collections found

questions

Title
What is the output when following statement is executed

What is the output when following statement is executed ?

>>>"a"+"bc"

  1. a
  2. bc
  3. bca
  4. abc
discuss
print(0xA + 0xB + 0xC)

print(0xA + 0xB + 0xC) :


  1. 0xA0xB0xC
  2. Error
  3. 0x22
  4. 33
discuss
What is the output when following code is executed

What is the output when following code is executed ?

>>>str1="helloworld"
>>>str1[::-1]

  1. dlrowolleh
  2. hello
  3. world
  4. helloworld
discuss
What is the output when following statement is executed

What is the output when following statement is executed ?

>>> print(‘x\97\x98’)

  1. Error
  2. 97 98
  3. x\97
  4. \x97\x98
discuss
What is the output when following statement is executed

What is the output when following statement is executed ?

>>>print('new' 'line')

  1. Error
  2. Output equivalent to print ‘new\nline’
  3. newline
  4. new line
discuss
What is the output when following code is executed

What is the output when following code is executed ?

>>>print r"\nhello"

  1. a new line and hello
  2. \nhello
  3. the letter r and then hello
  4. error
discuss
What arithmetic operators cannot be used with strings

What arithmetic operators cannot be used with strings ?


  1. +
  2. *
  3. -
  4. All of the mentioned
discuss
What is the output when following code is executed

What is the output when following code is executed ?

>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]

  1. olleh
  2. hello
  3. h
  4. o
discuss
The output of executing string.ascii_letters can also be achieved by

The output of executing string.ascii_letters can also be achieved by:


  1. string.ascii_lowercase_string.digits
  2. string.ascii_lowercase+string.ascii_upercase
  3. string.letters
  4. string.lowercase_string.upercase
discuss
What is the output when following statement is executed

What is the output when following statement is executed ?

>>>"abcd"[2:]

  1. a
  2. ab
  3. cd
  4. dc
discuss
What is the output of the following code

What is the output of the following code ?

class tester:
    def __init__(self, id):
        self.id = str(id)
        id="224"
 
>>>temp = tester(12)
>>>print(temp.id)

  1. 224
  2. Error
  3. 12
  4. None
discuss
What is the output of the following code

What is the output of the following code ?

>>>example = "snow world"
>>>print("%s" % example[4:7])

  1. wo
  2. world
  3. sn
  4. rl
discuss
What is the output of the following code

What is the output of the following code ?

>>>max("what are you")

  1. error
  2. u
  3. t
  4. y
discuss
What is the output of the following code

What is the output of the following code ?

>>>example = "snow world"
>>>example[3] = 's'
>>>print example

  1. snow
  2. snow world
  3. Error
  4. snos world
discuss
Given a string example=”hello” what is the output of example.count(l)

Given a string example=”hello” what is the output of example.count(l)


  1. 2
  2. 1
  3. None
  4. 0
discuss
What is the output of the following code

What is the output of the following code ?

>>>example = "helle"
>>>example.find("e")

  1. Error
  2. -1
  3. 1
  4. 0
discuss
What is the output of the following code

What is the output of the following code

>>>example = "helle"
>>>example.rfind("e")

  1. -1
  2. 4
  3. 3
  4. 1
discuss
What is the output of the following code

What is the output of the following code ?

>>>example="helloworld"
>>>example[::-1].startswith("d")

  1. dlrowolleh
  2. True
  3. -1
  4. None
discuss
To concatenate two strings to a third what statements are applicable

To concatenate two strings to a third what statements are applicable ?


  1. s3 = s1 . s2
  2. s3 = s1.add(s2)
  3. s3 = s1.__add__(s2)
  4. s3 = s1 * s2
discuss
What is the output when following statement is executed

What is the output when following statement is executed ?

>>>chr(ord('A'))

  1. A
  2. B
  3. a
  4. Error
discuss
total MCQs: 129

MCQs

129

Views

138

Best Answers

299

Points

5