.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » Nucleus Placement Papers » Nucleus Previous Year Placement Paper

 

Nucleus Placement Paper -: Python Questions With Answers


Advertisements
Advertisements




Nucleus Previous Years Solved Sample Placement Papers

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

    
    for i in [1, 2, 3, 4][::-1]:
        print(i, end=' ')
        

    A. 4 3 2 1 Answer: Option A

    B. error

    C. 1 2 3 4

    D. none of the mentioned

  2. Solution: [::-1] reverses the list.
  3. What will be the output of the following Python statement?

    
    >>> "a" + "bc"
        

    A. bc

    B. abc Answer: Option B

    C. a

    D. bca

  4. Solution: + operator is concatenation operator.
  5. Which function is called when the following Python program is executed?

    
    f = foo()
    format(f)
        

    A. str()

    B. format()

    C. __str__()

    D. __format__()

  6. Solution: The function __format__() is called when the format() function is used.
  7. What will be the output of the following Python code?

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

    A. 12 Answer: Option A

    B. 224

    C. None

    D. Error

  8. Solution: Id in this case will be the attribute of the instance.
  9. What will be the output of the following Python program?

    
    def foo(x):
        x[0] = ['def']
        x[1] = ['abc']
        return id(x)
    q = ['abc', 'def']
    print(id(q) == foo(q))
        

    A. Error

    B. None

    C. False

    D. True Answer: Option D

  10. Solution: The same object is modified in the function.
  11. Which module in the Python standard library parses options received from the command line?

    A. getarg

    B. getopt Answer: Option B

    C. main

    D. os

  12. Solution: getopt parses options received from the command line.
  13. What will be the output of the following Python program?

    
    z = set('abc')
    z.add('san')
    z.update(set(['p', 'q']))
    z
        

    A. {‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}

    B. {‘abc’, ‘p’, ‘q’, ‘san’}

    C. {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’} Answer: Option C

    D. {‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san’}

  14. Solution: The code shown first adds the element ‘san’ to the set z. The set z is then updated and two more elements, namely, ‘p’ and ‘q’ are added to it. Hence the output is: {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}.
  15. What arithmetic operators cannot be used with strings in Python?

    A. *

    B. – Answer: Option B

    C. +

    D. All of the mentioned

  16. Solution: + is used to concatenate and * is used to multiply strings.




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy