Logo

Python Questions Set 173:

Quiz Mode

~x is equivalent to ?

1
2
3
4

Solution:

What is the output of the following code?

chr(ord('A'))

1
2
3
4

Solution:

What is the output of "hello World".split()

1
2
3
4

Solution:

 

What will be the output of the following Python code snippet?

print('cd'.partition('cd'))

1
2

Solution:

 

What will be the output of the following Python code?

>>>example = "snow world"

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

1
2

Solution:

 

What will be the output of the following Python code?

  1. def cube(x):
  2. return x * x * x      
  3. x = cube(3) 
  4. print x

1
2
3
4

Solution:

 

What will be the output of the following Python code?

>>>names = ['Amir', 'Bear', 'Charlton', 'Daman']

>>>print(names[-1][-1])

1
2

Solution:

What is output of given program?


m='YES'


if m=='YES':

    #print("YES")

    print("Y")

else:

    print("NO")

1
2
3
4

Solution:

What is the output of the following Python code?

print('xyyxyyxyxyxxy'.replace('xy', '12', 100))

1
2
3
4

Solution:

 Which of the following statement is true about the pass statement? 

1
2
3
4

Solution: