GeekInterview.com
Series: Subject: Topic:

Python Interview Questions

Showing Questions 1 - 20 of 24 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

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

Asked By: GregMark | Asked On: Jan 8th, 2007

Answered by: Sreekrishnan r on: Jun 25th, 2014

Pass

Answered by: Saumya Saxena Gupta on: Jun 20th, 2014

Pass

What is used to represent strings in python.Is double quotes used for string representation or single quotes used for string representation in python?

Asked By: RyanJames | Asked On: Jan 8th, 2007

Answered by: Saumya Saxena Gupta on: Jun 20th, 2014

Both the quotes can be used

Answered by: jayavanth on: Apr 29th, 2013

In python both single quote and double quotes are valid for string representation and also we can use triple quote for multiline string representation.

What is the method does join() in python belong to?

Asked By: Remasri | Asked On: Jan 8th, 2007

Answered by: Saumya Saxena Gupta on: Jun 20th, 2014

Used for joining strng operations

Answered by: jayavanth on: Apr 29th, 2013

Join is built in string function used for string separation.

How is memory managed in python?

Asked By: sripri | Asked On: Jan 8th, 2007

Answered by: jayavanth on: Apr 29th, 2013

Like other programming language python also has garbage collector which will take care of memory management in python.

Answered by: parthvora18 on: Jun 3rd, 2008

Memory is managed through private heaps. Private heap is managed by python memory manager.

What is the built-in function used in python to iterate over a sequence of numbers?

Asked By: fred | Asked On: Jan 8th, 2007

Answered by: addy on: Oct 15th, 2012

Yup, I think youre right. enumerate will iterate over a list, and that list could have numbers in it e.g.:

>>> [ (i,j) for i,j in enumerate([9,10,11,12])]
[(0, 9), (1, 10), (2, 11), (3, 12)]

Answered by: Nagappan on: Nov 13th, 2007

Range is the built-in function to be used for interating the sequence of numbers.for iter in range (0, 10):   print iter # prints 0 to 9for iter in range (0, 10, 2): # The last argument is the sequence to use. Default is 1.    print iter # prints 0, 2, 4, 6, 8

Python popularity

Asked By: ushanamballa | Asked On: Jan 4th, 2009

Why python is not that much of populAR, when compared to other programming languages?

Answered by: suji on: Mar 2nd, 2012

Python is not so useful in web environment where the user interface is the browser. Hence, lot of people are using PHP for different design goals. Google is tightly connected with python as they make ...

Phyton advantages and dis-advantages

Asked By: torch_619 | Asked On: Aug 2nd, 2010

What are the advantage and dis-advantage of phyton programming language?

Answered by: suji on: Mar 2nd, 2012

Python is more like java and bit cumbersome, but it leads to a better design. Python is an interpreted language, high level programming, pure object-oriented, high performance server side scripting la...

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

Asked By: Bessie | Asked On: Jan 8th, 2007

Answered by: Geek4Geek on: Jun 13th, 2011

No. Python does not have any switch or case statement. But it provides other ways of achieving multiway branching such as if-elif statements and dictionaries. Example 1: (Using if-elif-else)if x ...

Answered by: Matt Brown on: Jun 9th, 2011

You can use a dictionary to simulate the switch statement.def doSomething():    print "doSomething() called"def doSomethingElse():    print "doSomethingEls...

Why can't lambda forms in python contain statements?

Asked By: janelyn | Asked On: Jan 8th, 2007

Answered by: muralic on: Feb 22nd, 2010

They are syntactically restricted to a single expression.

Answered by: santosh malvi on: Apr 9th, 2007

A lambda statement is used to create new function objects and then return them at runtime thats why  lambda forms in Python didn't contain statement.

How is the implementation of python's dictionaries done?

Asked By: fred | Asked On: Jan 8th, 2007

Answered by: tomanihskb on: Feb 10th, 2009

A hash value of the key is computed using a hash function, The hash value addresses a location in an array of "buckets" or "collision lists" which contains the (key , value) pa...

Answered by: dilbert_here00 on: Dec 3rd, 2007

Using curly brackets -> {}eg: {'a':'123', 'b':'456'}

What is the optional statement used in a try ... Except statement in python?

Asked By: norman | Asked On: Jan 8th, 2007

Answered by: Priya Patel on: Oct 20th, 2007

There are 2 optional clauses used in try...except statements: 1. else clause: It is useful for code that must be executed when the try block doesn't create any exception2. finally clause:Its is useful for code that must be executed irrespective of whether an exception is generated or not.

Answered by: xeio on: Sep 25th, 2007

Try ... except (...) ... [finally]

What is list comprehensions feature of python used for?

Asked By: SachinDeo | Asked On: Jan 8th, 2007

Answered by: Priya Patel on: Oct 19th, 2007

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 for clause, then zero or more for or
if clauses.

What is __slots__ and when is it useful?

Asked By: Vince Gatto | Asked On: Oct 10th, 2007

Normally, all class objects have an __dict__ which allows new attributes to be bound to a class instance at runtime. When a class is defined with __slots__, only attributes whose names are present in the __slots__ sequence are allowed. This results in instances of this class not having an __dict__...

What are all the operating system that python can run on?

Asked By: GregMark | Asked On: Jan 8th, 2007

Answered by: varsha5in on: Oct 2nd, 2007

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

What are the disadvantages of the python programming language?

Asked By: Robert | Asked On: Jan 8th, 2007

Answered by: sripri on: Apr 9th, 2007

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

Why isn't all memory freed when python exits?

Asked By: Robert | Asked On: Jan 8th, 2007

Answered by: stranger1 on: Sep 28th, 2007

Objects referenced from the global namespaces of Python modules are not always deallocated when Python exits. This may happen if there are circular references. There are also certain bits of memory ...

Does python support strongly for regular expressions? What are the other languages that support strongly for regular expressions?

Asked By: christia | Asked On: Jan 8th, 2007

Answered by: stranger1 on: Sep 28th, 2007

Yes python strongly support regular expression. Other languages supporting regular expressions are: Delphi, Java, Java script, .NET, Perl, Php, Posix, python, Ruby, Tcl, Visual Basic, XML schema, VB script, Visual Basic 6.

Why was the language called as python?

Asked By: nancyphilips | Asked On: Jan 8th, 2007

Answered by: stranger1 on: Sep 28th, 2007

At the same time he began implementing Python, Guido van Rossum was also reading the published scripts from "Monty Python's Flying Circus" (a BBC comedy series from the seventies, in the...

Does python support multiple inheritance?

Asked By: SachinDeo | Asked On: Jan 8th, 2007

Answered by: andy on: Sep 7th, 2007

Yes it does support.

What is the Java implementation of python popularly known as?

Asked By: Remasri | Asked On: Jan 8th, 2007

Answered by: Andy on: Sep 7th, 2007

Jython

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.