String in Python Quiz 2

Share with others

Enter details and click on Next

Q11. What is the index value of 'i' in string "Learning"

Q12. Index value should be of type ________.

Q13. What type of error is returned by the following :

str = "Learning"
print(str[10])

Q14. Which character will have same index value when you access elements from the beginning and from the end(ignore the negative sign) in the following string.

s = "Welcome to my blog"

Q15. String traversal can be done using 'for' loop only.(T/F)

Q16. Which of the following statement is correct in accessing each element of string?

a)
a="Learning"
while(i):
print(i)

b)
a="Learning"
for i in a:
print(i)

Q17. Name the function which is used to find length of string.

Q18. Write the output of the following code :

for i in "STR":
print(i)

Q19. Write the output of the following code :

a="Learn"
while(a):
print(a)

Q20. Which operator is used with integers as well as with strings?


Share with others

2 thoughts on “String in Python Quiz 2”

Leave a Reply

error: Content is protected !!