41.How will you remove all leading whitespace in string?
lstrip() − Removes all leading whitespace in string.
42.How will you replaces all occurrences of old substring in string with new string?
replace(old, new [, max]) − Replaces all occurrences of old in string with new or at most max occurrences if max given.
43.How will you remove all leading and trailing whitespace in string?
strip([chars]) − Performs both lstrip() and rstrip() on string.
44.How will you get titlecased version of string?
title() − Returns "titlecased" version of string, that is, all words begin with uppercase and the rest are lowercase.
45.What is the output of len([1, 2, 3])?
3.
46.What is the output of [1, 2, 3] + [4, 5, 6]?
[1, 2, 3, 4, 5, 6]
47.What is the output of ['Hi!'] * 4?
['Hi!', 'Hi!', 'Hi!', 'Hi!']
48.What is the output of 3 in [1, 2, 3]?
True
49.What is the output of for x in [1, 2, 3]: print x?
1 2 3
50.What is the output of L[2] if L = [1,2,3]?
3, Offsets start at zero.
lstrip() − Removes all leading whitespace in string.
42.How will you replaces all occurrences of old substring in string with new string?
replace(old, new [, max]) − Replaces all occurrences of old in string with new or at most max occurrences if max given.
43.How will you remove all leading and trailing whitespace in string?
strip([chars]) − Performs both lstrip() and rstrip() on string.
44.How will you get titlecased version of string?
title() − Returns "titlecased" version of string, that is, all words begin with uppercase and the rest are lowercase.
45.What is the output of len([1, 2, 3])?
3.
46.What is the output of [1, 2, 3] + [4, 5, 6]?
[1, 2, 3, 4, 5, 6]
47.What is the output of ['Hi!'] * 4?
['Hi!', 'Hi!', 'Hi!', 'Hi!']
48.What is the output of 3 in [1, 2, 3]?
True
49.What is the output of for x in [1, 2, 3]: print x?
1 2 3
50.What is the output of L[2] if L = [1,2,3]?
3, Offsets start at zero.
No comments:
Post a Comment