Python Interview Questions You'll Most Likely Be Asked

Price: $19.95


Python Interview Questions You'll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver's seat and helps them steer their way to impress the interviewer.



Table of Contents
1. General Python Concepts
2. Python Looping
3. Python Conditionals
4. String Manipulation
5. Python Data Types
6. File Manipulation
7. Python Thread Management
8. Python Database Interface
9. Python Internet Communication
10. HTML / XML in Python
11. HR Questions



a) 200 Python Interview Questions, Answers and Proven Strategies for getting hired as an IT professional

b) Dozens of examples to respond to interview questions

c) 51 HR Questions with Answers and Proven strategies to give specific, impressive, answers that help nail the interviews

d) 2 Aptitude Tests download available on



Sample from the book
(Below Questions and Answers are randomly taken from different pages of the book)

31: Given the string “I Love Python” print out each character except for the spaces, using a for loop.


myString = “I Love Python”

for myChar in myString:

if myChar == ‘ ’:


print myChar


32: Illustrate how to execute a loop ten times.


i = 1

while i < 10:


i += 1


33: When using a while loop, a condition was encountered that made staying in the loop pointless, what statement is used to transfer control?


The break statement is used to terminate processing of the loop and move on to the next block of code.


104: What does the ‘b’ modifier do when appended to a file mode?


It changes the handling of the file from text to binary mode.


105: What does the ‘U’ modifier do when appended to a file mode?


It applies the universal new-line translator to the file when it is opened.


106: How is the buffer size specified in file opening?


It is an optional parameter to the open function. A 0 indicates the file is unbuffered, 1 indicates that line by line buffering. Any other positive number is the actual buffer size to be allocated.


160: Illustrate retrieving a list of available tables in a MySQL database.


import MySQLdb

myDB = MySQLdb.connect(host=””, user=”username”, passwd=”password”)

myCursor = myDB.cursor()

myCursor.execute(“SHOW TABLES”)

myResults = myCursor.fetchall()



169: Illustrate retrieving the number of messages available on a mail server.


Import poplib

myPOP = poplib.POP3(‘’)



myMessageCount = len(mPOP.list()[1])


182: Illustrate parsing a URL into a tuple.


Import urlparse

myTuple = urlparse.urlparse(“



190: Illustrate retrieving a cookies from a URL.


Import urllib2

Import cookielib

myJar= cookielib.LWPCookieJar()

myOpener = urllib2.build_opener( urllib2.HTTPCookieProcessor(myJar))


myRequest =urllib2. Request(“”)

myHTML = urllib2.urlopen(myRequest)

for cookie in enumerate(myJar)

print cookie