Suppose list1 is [1, 5, 9], what is sum(list1)?
-------------- function is used to add data to the list
Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
What is the output of the following Python code snippet?
abc="therewasatime"
abc[:3]
What will be the output of the following Python code?
x = [12, 34]
print(len(' '.join(list(map(int, x)))))
What will be the output of the following Python code snippet?
x = 'abcd'
for i in range(len(x)):
print(x)
x = 'a'
v1 = "\neither"
v2 = "\there"
v3 = "\nor"
v4 = "\there"
print "%s %r %r %s" %(v1,v2,v3,v4)
def heading(str):
print ("+++%s+++" % str)
heading.id = 1
heading.text = "Python functions"
heading("%d %s" % (heading.id, heading.text))