.
  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?
            print("abc. DEF".capitalize())
            

    A. Abc. def Answer: Option A

    B. abc. def

    C. Abc. Def

    D. ABC. DEF

  2. Solution: The capitalize() function converts the first character of the string to uppercase and the rest to lowercase.
  3. Which of the following statements is used to create an empty set in Python?

    A. ()

    B. []

    C. { }

    D. set() Answer: Option D

  4. Solution: {} creates an empty dictionary, while set() creates an empty set.
  5. What will be the value of ‘result’ in the following Python program?
            list1 = [1,2,3,4]
            list2 = [2,4,5,6]
            list3 = [2,6,7,8]
            result = list()
            result.extend(i for i in list1 if i not in (list2+list3) and i not in result)
            result.extend(i for i in list2 if i not in (list1+list3) and i not in result)
            result.extend(i for i in list3 if i not in (list1+list2) and i not in result)
            

    A. [1, 3, 5, 7, 8] Answer: Option A

    B. [1, 7, 8]

    C. [1, 2, 4, 7, 8]

    D. Error

  6. Solution: The code generates a list containing elements unique to only one of the input lists. Hence, the result is [1, 3, 5, 7, 8].
  7. To add a new element to a list we use which Python command?

    A. list1.addEnd(5)

    B. list1.addLast(5)

    C. list1.append(5) Answer: Option C

    D. list1.add(5)

  8. Solution: The append() function is used to add an element to the end of a list in Python.
  9. What will be the output of the following Python code?
            print('*', "abcde".center(6), '*', sep='')
            

    A. * abcde *

    B. *abcde * Answer: Option B

    C. * abcde*

    D. * abcde *

  10. Solution: The center() function pads the string symmetrically, but when the final length is even, padding is added to the right first.
  11. What will be the output of the following Python code?
            list1 = [1, 3]
            list2 = list1
            list1[0] = 4
            print(list2)
            

    A. [1, 4]

    B. [1, 3, 4]

    C. [4, 3] Answer: Option C

    D. [1, 3]

  12. Solution: Lists in Python are mutable and assignment results in both variables referring to the same list. Changes made via one reference affect the other.
  13. Which one of the following is the use of functions in Python?

    A. Functions don’t provide better modularity for your application

    B. You can’t also create your own functions

    C. Functions are reusable pieces of programs Answer: Option C

    D. All of the mentioned

  14. Solution: Functions allow you to organize code into reusable blocks, making applications more modular and easier to maintain.
  15. Which of the following Python statements will result in the output: 6?
            A = [[1, 2, 3],
                 [4, 5, 6],
                 [7, 8, 9]]
            

    A. A[2][1]

    B. A[1][2] Answer: Option B

    C. A[3][2]

    D. A[2][3]

  16. Solution: A[1][2] refers to the second row and third column, which contains the value 6.




 


.

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