Q.1.
What will be the output of the following Python code? class father: def __init__(self, param): self.o1 = param class child(father): def __init__(self, param): self.o2 = param >>>obj = child(22)>>>print "%d %d" % (obj.oobj.o2)
Q.2.
What will be the output of the following Python code? class tester: def __init__(self, id): self.id = str(id) id=">>>temp = tester(12)>>>print(temp.id)
Q.3.
What will be the output of the following Python code? >>>example = "snow world">>>print("%s" % example[4:7])
Q.4.
What will be the output of the following Python code? >>>example = "snow world">>>example[= 's'>>>print example
Q.5.
What will be the output of the following Python code? >>>max("what are you")
Q.6.
Given a string example=”hello” what is the output of example.count(‘l’)?
Q.7.
What will be the output of the following Python code? >>>example = "helle">>>example.find("e")
Q.8.
What will be the output of the following Python code? >>>example = "helle">>>example.rfind("e")
Q.9.
What will be the output of the following Python code? >>>example="helloworld">>>example[::-1].startswith("d")
Q.10.
To concatenate two strings to a third what statements are applicable?