Current Recruitment 2023 | mahajobs | Vartaman Bharti | नोकरी

Saturday, October 10, 2020

Python Programming Quiz

National Level Quiz on Python Programming


National Level Quiz on Python Programming

 

Question : What will be the output of below Python code? tupl=() tupl1=tupl*2 print(len(tupl1)) 

Answer : 0

 

Question : What will be the output of below Python code? tuple1=(2,4,3) tuple3=tuple1*2 print(tuple3) 

Answer : (2,4,3,2,4,3)

 

Question : What will be the output of below Python code?list1=[8,0,9,5]print(list1[::-1]) 

Answer : [5,9,0,8]

 

Question : What will be the result after the execution of above Python code?list1=[3,2,5,7,3,6]list1.pop(3)print(list1)

Answer : [3,2,5,3,6]

 

Question : What will be the output of following Python code?set1={2,5,3}set2={3,1}set3={}set3=set1&set2print(set3) 

Answer : {3}

 

Question : What will be the output of below Python code?str1="Information"print(str1[2:8]) 

Answer : format

 

Question : Which of the following will result in an error?str1="python" 

Answer : str1[1]="x"

 

Question : Which of the following is correct with respect to above Python code?d={"a":3,"b":7} 

Answer : All of the above.

 

Question : What will be the output of the following Python code snippet? print('ab cd ef'.title()) 

Answer : Ab Cd Ef

 

Question : In data science, which of the python library are more popular ? 

Answer : Pandas

 

Question : What is the output when we execute list(“hello”)? 

Answer : [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]

 

Question : What will be the output of the following Python code?>>>t = (1, 2)>>>2 * t 

Answer : (1, 2, 1, 2)

 

Question : Which of the following is an invalid statement? 

Answer : a b c = 1000 2000 3000

 

Question : What is the value of this expression?2**2**3**1 

Answer : 256

 

Question : Which of the following is used for machine learning in python? 

Answer : scikit-learn

 


No comments:

Post a Comment

if you have any doubt please let me know