The Complete Project Source Code Platform

Kashipara.com is a community of ONE million programmers and students, Just like you, Helping each other.Join them. It only takes a minute: Sign Up

Job Resume Template

popular python Job Interview Questions And Answers


Why don't preparation your interviews. Best and top asking questions python questions and answers. Prepare your job python interview with us. Most frequently asked questions in python interview. Top 10 most common python interview questions and answer to ask. python most popular interview question for fresher and experiences. We have good collection of python job interview questions and answers. Ask interview questions and answers mnc company.employee ,fresher and student. python technical questions asking in interview. Complete placement preparation for major companies tests and python interviews,Aptitude questions and answers, technical, interview tips, practice tests, assessment tests and general knowledge questions and answers.


Free Download python Questions And Answers Pdf.


popular python FAQ python Interview Questions and Answers for Experiences and Freshers.



Which of the languages does Python resemble in its class syntax?

C++ is the appropriate language that Python resemble in its class syntax.

python   2014-01-13 10:24:59

Who created the Python programming language?

Python programming language was created by Guido van Rossum.

python   2014-01-13 10:25:21

What are the disadvantages of the Python programming language?

One of the disadvantages of the Python programming language is it is not suited for fast and memory intensive tasks.

python   2014-01-13 10:24:07

Explain how to overload constructors (or methods) in Python.

_init__ () is a first method defined in a class. when an instance of a class is created, python calls __init__() to initialize the attribute of the object.

Following example demonstrate further:

class Employee:

def __init__(self, name, empCode,pay):
self.name=name
self.empCode=empCode
self.pay=pay

e1 = Employee("Sarah",99,30000.00)

e2 = Employee("Asrar",100,60000.00)
print("Employee Details:")

print(" Name:",e1.name,"Code:", e1.empCode,"Pay:", e1.pay)
print(" Name:",e2.name,"Code:", e2.empCode,"Pay:", e2.pay)
---------------------------------------------------------------
Output

Employee Details:
(' Name:', 'Sarah', 'Code:', 99, 'Pay:', 30000.0)
(' Name:', 'Asrar', 'Code:', 100, 'Pay:', 60000.0)

python   2014-01-13 07:24:36

Does python support switch or case statement in Python? If not what is the reason for the same?

No. You can use multiple if-else, as there is no need for this.

python   2014-01-13 10:23:04

Explain how python is interpreted.

Python program runs directly from the source code. Each type Python programs are executed code is required. Python converts source code written by the programmer into intermediate language which is again translated it into the native language / machine language that is executed. So Python is an Interpreted language.

python   2013-12-28 10:39:40

Which all are the operating system that Python can run on?

Python can run of every operating system like UNIX/LINUX, Mac, Windows, and others.

python   2014-01-13 10:21:25

What is the language from which Python has got its features or derived its features?

Most of the object oriented programming languages to name a few are C++, CLISP and Java is the language from which Python has got its features or derived its features.

python   2014-01-13 10:23:47

How is the Implementation of Pythons dictionaries done?

Using curly brackets -> {}

E.g.: {'a':'123', 'b':'456'}

python   2014-01-13 10:23:26

Why is not all memory freed when Python exits?

Objects referenced from the global namespaces of Python modules are not always de-allocated when Python exits. This may happen if there are circular references. There are also certain bits of memory that are allocated by the C library that are impossible to free (e.g. a tool like the one Purify will complain about these). Python is, however, aggressive about cleaning up memory on exit and does try to destroy every single object.

If you want to force Python to delete certain things on de-allocation, you can use the at exit module to register one or more exit functions to handle those deletions.

python   2014-01-13 10:24:34

Explain how to make Forms in python.

As python is scripting language forms processing is done by Python. We need to import cgi module to access form fields using FieldStorage class.

Every instance of class FieldStorage (for ‘form’) has the following attributes:

form.name: The name of the field, if specified.
form.filename: If an FTP transaction, the client-side filename.
form.value: The value of the field as a string.
form.file: file object from which data can be read.
form.type: The content type, if applicable.
form.type_options: The options of the ‘content-type’ line of the HTTP request, returned as a dictionary.
form.disposition: The field ‘content-disposition’; None if unspecified.
form.disposition_options: The options for ‘content-disposition’.
form.headers: All of the HTTP headers returned as a dictionary.

A code snippet of form handling in python:

import cgi

form = cgi.FieldStorage()
if not (form.has_key("name") and form.has_key("age")):
print "<H1>Name & Age not Entered</H1>"
print "Fill the Name & Age accurately."
return
print "<p>name:", form["name"].value
print "<p>Age:", form["age"].value

python   2013-12-30 10:22:44

What are the uses of List Comprehensions feature of Python?

List comprehensions help to create and manage lists in a simpler and clearer way than using map(), filter() and lambda. Each list comprehension consists of an expression followed by a clause, then zero or more for or if clauses.

python   2014-01-13 10:21:05

What is a negative index in python?

Python arrays & list items can be accessed with positive or negative numbers (also known as index). For instance our array/list is of size n, then for positive index 0 is the first index, 1 second, last index will be n-1. For negative index, -n is the first index, -(n-1) second, last negative index will be – 1. A negative index accesses elements from the end of the list counting backwards.

An example to show negative index in python.

>>> import array
>>> a= [1, 2, 3]
>>> print a[-3]
1
>>> print a[-2]
2
>>> print a[-1]
3

python   2014-01-13 07:23:20

What is the statement that can be used in Python if a statement is required syntactically but the program requires no action?

Pass is a no-operation/action statement in python

If we want to load a module and if it does not exist, let us not bother, let us try to do other task. The following example demonstrates that.

Try:

Import module1

Except:

Pass

python   2014-01-13 10:21:55

Describe how to generate random numbers in Python.

Thee standard module random implements a random number generator.

There are also many other in this module, such as:

uniform(a, b) returns a floating point number in the range [a, b].
randint(a, b)returns a random integer number in the range [a, b].
random()returns a floating point number in the range [0, 1].

Following code snippet show usage of all the three functions of module random:
Note: output of this code will be different evertime it is executed.

import random
i = random.randint(1,99)# i randomly initialized by integer between range 1 & 99
j= random.uniform(1,999)# j randomly initialized by float between range 1 & 999
k= random.random()# k randomly initialized by float between range 0 & 1
print("i :" ,i)
print("j :" ,j)
print("k :" ,k)
__________
Output -
('i :', 64)
('j :', 701.85008797642115)
('k :', 0.18173593240301023)

Output-
('i :', 83)
('j :', 56.817584548210945)
('k :', 0.9946957743038618)

python   2014-01-13 07:25:41

Explain indexing and slicing operation in sequences

Different types of sequences in python are strings, Unicode strings, lists, tuples, buffers, and xrange objects. Slicing & indexing operations are salient features of sequence. indexing operation allows to access a particular item in the sequence directly ( similar to the array/list indexing) and the slicing operation allows to retrieve a part of the sequence. The slicing operation is used by specifying the name of the sequence followed by an optional pair of numbers separated by a colon within square brackets say S[startno.:stopno]. The startno in the slicing operation indicates the position from where the slice starts and the stopno indicates where the slice will stop at. If the startno is ommited, Python will start at the beginning of the sequence. If the stopno is ommited, Python will stop at the end of the sequence..

Following code will further explain indexing & slicing operation:
>>> cosmeticList =[‘lipsstick’,’facepowder’,eyeliner’,’blusher’,kajal’]
>>> print “Slicing operation :”,cosmeticList[2:]
Slicing operation :[‘eyeliner’,’blusher’,kajal’]
>>>print “Indexing operation :”,cosmeticList[0]
“Indexing operation :lipsstick

python   2013-12-30 10:21:54

Describe how to send mail from a Python script.

The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine.

A sample email is demonstrated below.

import smtplib
SERVER = smtplib.SMTP(‘smtp.server.domain’)
FROM = sender@mail.com
TO = ["user@mail.com"] # must be a list
SUBJECT = "Hello!"
TEXT = "This message was sent with Python's smtplib."
# Main message
message = """
From: Sarah Naaz < sender@mail.com >
To: CarreerRide user@mail.com
Subject: SMTP email msg
This is a test email. Acknowledge the email by responding.
""" % (FROM, ", ".join(TO), SUBJECT, TEXT)
server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)
server.quit()

python   2014-01-13 07:25:11

Is there any tool used to find bugs or carrying out static analysis?

Yes. PyChecker is the static analysis tool used in python to find bugs in source code, warns about code style and complexity etc. Pylint is a tool that verifies whether a module satisfies standards of coding and makes it possible to add custom feature and write plug-ins.

python   2013-12-28 09:18:25

Why is not all memory freed when Python exits?

Objects referenced from the global namespaces of Python modules are not always de-allocated when Python exits. This may happen if there are circular references. There are also certain bits of memory that are allocated by the C library that are impossible to free (e.g. a tool like the one Purify will complain about these). Python is, however, aggressive about cleaning up memory on exit and does try to destroy every single object.

If you want to force Python to delete certain things on de-allocation, you can use the at exit module to register one or more exit functions to handle those deletions.

python   2014-01-01 11:50:43




popular python questions and answers for experienced


python best Interview Questions have been designed especially to get you acquainted with the nature of questions you may encounter during your interview for the subject of python Programming Language. here some questions that helpful for your interview. python 2024 job interview questions with answers. python for employee and fresher. Here we present some more challenging practice python interview questions and answers that were asked in a real interview for a python developer position. These questions are really good to not just test your python skills, but also your general development knowledge. python programming learning. we hope this python interview questions and answers would be useful for quick glance before going for any python job interview.