Infosys Campus Connect - Non - IT Branches (Batch 1) Quiz

50 Questions | Total Attempts: 84

SettingsSettingsSettings
Please wait...
Infosys Campus Connect -  Non - IT Branches (Batch 1) Quiz

This quiz is for Batch 1( NON IT batch) and contains 50 MCQ questions. All the best :)


Questions and Answers
  • 1. 
    What is the output of the following? a = 4.5 b = 2 print (a//b)
    • A. 

      2.0

    • B. 

      2.5

    • C. 

      2

    • D. 

      Error

  • 2. 
    A = True b = False c = False if not a or b:     print (1) elif not a or not b and c:     print (2) elif not a or b or not b and a:     print (3) else:     print (4)
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

  • 3. 
    For i in  range(2):     print (i) for i in range(4,6):     print (i)
    • A. 

      0 1 4 6

    • B. 

      0 1 4 5

    • C. 

      0 1 4 2

    • D. 

      1 2 3 4 5

  • 4. 
    A = "hello and welcome to python " b = 13 print (a + b)
    • A. 

      Hello and welcome to python13

    • B. 

      13hello and welcome to python

    • C. 

      Hello and welcome to python 13

    • D. 

      None of the above

  • 5. 
    List1 = ['physics', 'chemistry', 1997, 2000] list2 = [1, 2, 3, 4, 5, 6, 7] print ("list1[0]: ", list1[0])              #statement 1 print ("list1[0]: ", list1[-2])            #statement 2 print ("list1[-2]: ", list1[1:])           #statement 3 print ("list2[1:5]: ", list2[1:5])  #statement 4
    • A. 

      List1[0]:  physics list1[0]:  2000 list1[-2]:  ['chemistry', 1997, 2000] list2[1:5]:  [2, 3, 4, 5]

    • B. 

      List1[0]:  physics list1[0]:  1997 list1[-2]:  ['chemistry', 1997, 2000] list2[1:5]:  [2, 3, 4, 5]

    • C. 

      List1[0]: chemistry list1[0]:  1997 list1[-2]:  ['chemistry', 1997, 2000] list2[1:5]:  [3,4,5,6]

    • D. 

      List1[0]:  physics list1[0]:  1997 list1[-2]:  ['chemistry', 1997, 2000] list2[1:5]:  [1, 3, 4, 5]

  • 6. 
    List1 = [1998, 2002, 1997, 2000] list2 = [2014, 2016, 1996, 2009] print ("list1 + list 2 = : ", list1 + list2)   #statement 1 print ("list1 * 2 = : ", list1 * 2 ) #statement 2
    • A. 

      List1 + list 2 = :  [1998, 2002, 1997, 2000, 2014, 2016, 1996, 2009]list1 * 2 = :  [2002, 1997, 2000, 1998, 2002, 1997, 2000,1998]

    • B. 

      List1 + list 2 = :  [1998, 2002, 1997, 2000, 2014, 2016, 1996, 2009] list1 * 2 = :  [1998, 2002, 2000,1997, 1998, 2002, 1997, 2000]

    • C. 

      List1 + list 2 = :  [1998, 2002, 1997, 2000, 2014, 2016, 1996, 2009] list1 * 2 = :  [1998, 2002, 1997, 2000, 1998, 2002, 1997, 2000]

    • D. 

      List1 + list 2 = :  [1998, 2002, 1997, 2000, 2014, 2016, 1996, 2009] list1 * 2 = :  [1998, 2002, 1997, 2000, 1998, 2002, 2000,1997]

  • 7. 
    List1 = [1, 2, 3, 4, 5] list2 = list1 list2[0] = 0; print ("list1= : ", list1)  #statement 2
    • A. 

      List1= :  [0, 2, 3, 4, 5]

    • B. 

      List1= :  [1, 2, 3, 4, 5]

    • C. 

      List1= :  [0, 1, 2, 3, 4]

    • D. 

      List1= :  [0, 2, 3, 4, 1]

  • 8. 
    X = ['ab', 'cd'] for i in x:     i.upper() print (x)
    • A. 

      ['ab', 'cd']

    • B. 

      ['AB', 'CD']

    • C. 

      ['cd', 'ab']

    • D. 

      ['cd', 'AB']

  • 9. 
    Def greetPerson(*name):      print('Hello', name) greetPerson('Frodo', 'Sauron')
    • A. 

      Hello('Frodo','Sauron')

    • B. 

      Syntax Error

    • C. 

      Hello   ('Frodo', 'Sauron')

    • D. 

      Hello('Sauron'Frodo'')

  • 10. 
    Suppose you need to print pi constant defined in math module. Which of the following code can do this task?
    • A. 

      Print(math.pi)

    • B. 

      Print(pi)

    • C. 

      From math import pi      print(pi)

    • D. 

      From math import pi print(math.pi)

  • 11. 
    Which of the following is the use of id() function in python?
    • A. 

      Returns the class of object

    • B. 

      Type of the object

    • C. 

      Memory location of the object

    • D. 

      All of above

  • 12. 
    A = {i: i * i for i in range(6)} print (a)
    • A. 

      Dictionary comprehension doesn’t exist

    • B. 

      {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6:36}

    • C. 

      {0: 0, 1: 1, 4: 4, 9: 9, 16: 16, 25: 25}

    • D. 

      {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}

  • 13. 
    Line =  "What will have so will" L = line.split('a') for i in L:      print(i, end=' ')  
    • A. 

      [‘What’, ‘will’, ‘have’, ‘so’, ‘will’]

    • B. 

      Wh t will h ve so will

    • C. 

      What will have so will

    • D. 

      [‘Wh’, ‘t will h’, ‘ve so will’]

  • 14. 
    I = 1 while True:     if i % 3 == 0:         break     print(i)     i + = 1
    • A. 

      1 2 3

    • B. 

      1 2

    • C. 

      Syntax Error

    • D. 

      None of these

  • 15. 
    List = [1, 2, 3, None, (1, 2, 3, 4, 5), ['Geeks', 'for', 'Geeks']] print len(list)
    • A. 

      11

    • B. 

      12

    • C. 

      5

    • D. 

      6

  • 16. 
    List = ['a', 'b', 'c', 'd', 'e'] print list[10:]
    • A. 

      []

    • B. 

      No output

    • C. 

      Error

    • D. 

      None of these

  • 17. 
    I = 0 while i < 3:     print(i)     i += 1 else:     print(0)
    • A. 

      0 1 2 3 0

    • B. 

      0 1 2 0

    • C. 

      0 1 2 

    • D. 

      Error

  • 18. 
    My_string = 'welcometocampusconnect' for i in range(len(my_string)):     print (my_string)     my_string = 'a'
    • A. 

      Welcometocampusconnectaaaaaaaaaaaa

    • B. 

      Welcometocampusconnect a a a a a a a a a a a a

    • C. 

      Welcometocampusconnect

    • D. 

      A a a a a a a a a a a a

  • 19. 
    If (7 < 0) and (0 < -7):     print("Hello") elif (7 > 0) or False:     print("Welcome") else:     print("Infosys")
    • A. 

      Hello

    • B. 

      Welcome

    • C. 

      Infosys

    • D. 

      None of the above

  • 20. 
    Data = 50 try:     data = data/0 except ZeroDivisionError:     print('Cannot divide by 0 ', end = '') else:     print('Division successful ', end = '')   try:     data = data/5 except:     print('Inside except block ', end = '') else:     print('Hello', end = '')
    • A. 

      Cannot divide by 0 Hello

    • B. 

      Cannot divide by 0

    • C. 

      Cannot divide by 0 Inside except block Hello

    • D. 

      Cannot divide by 0 Inside except block

  • 21. 
    Which of the following statements contains an error?
    • A. 

      SELECT * FROM emp WHERE empid = 493945;

    • B. 

      SELECT empid FROM emp WHERE empid= 493945;

    • C. 

      SELECT empid FROM emp;

    • D. 

      SELECT empid WHERE empid = 56949 AND lastname = ‘SMITH’;

  • 22. 
    Which one is correct?
    • A. 

      Primary Key Ì Super Key Ì Candidate Key

    • B. 

      Candidate Key Ì Super Key Ì Primary Key

    • C. 

      Primary Key Ì Candidate Key Ì Super Key

    • D. 

      Super Key Ì Primary Key Ì Candidate Key

  • 23. 
    Which of the following group functions ignore NULL values?
    • A. 

      Max

    • B. 

      Min

    • C. 

      Sum

    • D. 

      All of above 

  • 24. 
    1. Empid
    2. Name
    3. Age
    4. Mobile
    1. Multivalued
    2. Derived
    3. Composite
    4. Simple
    • A. 

      1-D, 2-C,3-B, 4-A

    • B. 

      1-C, 2-B, 3-D, 4-A

    • C. 

      1-B, 2-A, 3-D, 4-C

    • D. 

      1-A, 2-C, 3-B, 4-D

  • 25. 
    Find the Salary in increasing order of all employees
    • A. 

      SELECT ENAME FROM EMP ORDER BY SALARY

    • B. 

      SELECT ENAME, SALARY FROM EMP

    • C. 

      SELECT ENAME,SALARY FROM EMP ORDER BY SALARY

    • D. 

      SELECT  ENAME, SALARY FROM EMP ORDER BY ENAME

Back to Top Back to top