Which of the following method call gives the position of X that occurs after n th position in the string S1 S1 Index ( x 1 S1 Index ( x N?
11-9-1: What is printed by the following statements? s = "python rocks"
print(s[1] * s.index("n"))
11-9-2: What will be printed when the following executes? str = "His shirt is red" pos = str.find("is") print(pos)
11-9-3: What will be printed when the following executes? str = "This is fun" str = str[5] print(str)
11-9-4: What is the value of s1 after the following code executes? s1 = "heY" s1 = s1.capitalize() s1.lower()
11-9-5: What would the following code print? Mali = 5 print("Mali" + " is " + str(Mali))
11-9-6: What is printed by the following statements? s = "python rocks" print(s[3])
11-9-7: What is printed by the following statements? s = "python is awesome" print(s[2] + s[-5])
11-9-8: What is printed by the following statements? s = "python rocks" print(len(s))
11-9-9: What is printed by the following statements: s = "Rose" s[1] = "i" print(s)
11-9-10: What is printed by the following statements: s = "ball" r = "" for item in s: r = item.upper() + r print(r)
11-9-11: What is printed by the following statements? s = "python rocks" print(s[7:11] * 3)
11-9-12: What is printed by the following statements? animal = "dog" print("animal" + animal)
11-9-13: What is printed by the following statements? animal = "dog" print("animal " + "animal") You have attempted of activities on this page Which of the following method call gives the position of X that occurs after n th?C. S1. indexOf('X', n)
Which of the following method call gives the position of the Firstoccurrence of x in the string S1?The Java String class indexOf() method returns the position of the first occurrence of the specified character or string in a specified string.
|