BreakInterview

1. What is the output of print list * 2 if list = [123, 'break']?

[123, 'break', 123, 'break']
[123, 'break']*2
Error
None of the above

2. Select the function that returns a randomly selected element from range?

seed([x])
choice(seq)
randrange([start,]stop[,step])
random()

3. Select the function that returns titlecased version of string?

case()
titlecase()
titleCase()
title()

4. What is the output of print str[2:5] if str = 'Break Interview'?

Break Interview
eak Interview
eak
None of the above

5. Select the function that compares elements of both dictionaries dict1, dict2?

dict1.compare(dict2)
compare(dict1,dict2)
dict1.cmp(dict2)
cmp(dict1,dict2)

6. Predict the output of print str[2:] if str = 'BreakInterview'?

BreakInterview
eakInterview
reakInterview
e

7. Select the function that checks in a string that all characters are white spaces?

isspace()
ispace()
isspaces()
None of the above

8. Select the function that merges elements in a sequence?

merge(seq)
join(seq)
attach(seq)
None of the above

9. Which of the following environment variable for Python contains the path of an initialization file containing Python source code?

PYTHONPATH
PYTHONSTARTUP
PYTHONHOME
PYTHONFILE

10. Select the function that gets a space-padded string with the original string left-justified to a total of width columns?

ljust(width[, fillchar])
just(width[, fillchar])
rjust(width[, fillchar])
None of the above