Time: 20:00

1. Suppose list1 is [3,4,5,20,5,25,1,3], what is the output of list1.count(5)?

मान लीजिए कि सूची1 [3,4,5,20,5,25,1,3] है, तो सूची1.गिनती(5) का आउटपुट क्या है?

2. Suppose list1 is [3,4,5,20,5,25,1,3], what is the output of list1 after list1.reverse()?

मान लीजिए कि सूची1 [3,4,5,20,5,25,1,3] है, तो सूची1.रिवर्स() के बाद सूची1 का आउटपुट क्या है?

3. Suppose listExample is [3,4,5,20,5,25,1,3], what is list1 after listExample.extend([34,5])?

मान लीजिए listExample [3,4,5,20,5,25,1,3] है, तो listExample.extend([34,5]) के बाद list1 क्या है?

4. Suppose listExample is [3,4,5,20,5,25,1,3], what is list1 after listExample.pop(1)?

मान लीजिए listExample [3,4,5,20,5,25,1,3] है, तो listExample.pop(1) के बाद list1 क्या है?

5. Suppose listExample is [3,4,5,20,5,25,1,3], what is list1 after listExample.pop()?

मान लीजिए कि listExample [3,4,5,20,5,25,1,3] है, listExample.pop() के बाद list1 क्या है?

6. What will be the output of the following Python code?

>>> "Welcome to Python".split()

7. What will be the output of the following Python code?

>>> list( "a#b#c#d" .split( '#' ))


8. What will be the output of the following Python code?

myList = [1, 5, 5, 5, 5, 1]
max = myList[ 0 ]
indexOfMax = 0
for i in range(1, len( myList )):
      if (myList[ i ] > max):
             max = myList[ i ]
             indexOfMax = i
print( indexOfMax )

9. What will be the output of the following Python code?

myList = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
      myList[i - 1] = myList[ i ]
for i in range(0, 6):
      print(myList[ i ], end = " ")

10. What will be the output of the following Python code?

list1 = [1, 3]
list2 = list1
list1[ 0 ] = 4
print( list2 )

11. What will be the output of the following Python code?

def f( values ) :
      values[ 0 ] = 44
v = [1, 2, 3]
f( v )
print( v )

12. What is "Hello" .replace( "l","e" )?

13. To retrieve the character at index 3 from string s="Hello". What command do we execute (multiple answers allowed)?

स्ट्रिंग s='हैलो' से सूचकांक 3 पर वर्ण पुनः प्राप्त करने के लिए। हम कौन सा आदेश निष्पादित करते हैं (एकाधिक उत्तरों की अनुमति है)?

14. To return the length of string s what command do we execute?

स्ट्रिंग की लंबाई वापस करने के लिए हम कौन सा कमांड निष्पादित करते हैं?

15. Suppose i is 5 and j is 4, i+j same as _ _ _ _ _

16. What function do you use to read a string?

किसी स्ट्रिंग को पढ़ने के लिए आप किस फ़ंक्शन का उपयोग करते हैं?

17. What will be the output of the following Python code?

values=[[3,4,5,1],[33,6,1,2]]
v=values[0][0]
for row in range(0,len(values)):
      for column in range(0,len(values[row])):
             if v < values[row][column]:
                    v= values[row][column]
print(v)

18. What will be the output of the following Python code?

values=[[3,4,5,1],[33,6,1,2]]
v=values[0][0]
for lst in values:
      for element in lst:
             if v > element:
                    v= element
print(v)

19. What will be the output of the following Python code?

values=[[3,4,5,1],[33,6,1,2]]
for row in values:
      row.sort()
      for element in row:
             print(element, end = " ")
      print()

20. What will be the output of the following Python code?

matrix=[[1,2,3,4],[4,5,6,7],[8,9,10,11],[12,13,14,15]]
for i in range(0, 4):
      print(matrix [i][1], end = " ")