Python String Quiz
String’s is one of the most important and confusing topics in Python. If you still feel that you need to revise the concepts visit the tutorial first and then come here to check your concepts. And the confident ones should move forward from here to the arena of our quiz.
Let’s get going and start the Python String quiz. All the best!
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
- Question 1 of 15
1. Question
Which of the following is true about Python Strings?
CorrectIncorrect - Question 2 of 15
2. Question
Which of the following is not a library function of string in Python?
CorrectIncorrect - Question 3 of 15
3. Question
Which of the below library function is used to check if a substring exists in the string?
CorrectIncorrect - Question 4 of 15
4. Question
Which of the following returns a boolean output when operated on a string?
CorrectIncorrect - Question 5 of 15
5. Question
Which of the following capitalizes each character of the sentence?
CorrectIncorrect - Question 6 of 15
6. Question
What is the output of the following code?
# Code Snippet StartvalStr = ‘QuizOrbit’
print(valStr[::-1])#Code Snippet End
CorrectIncorrect - Question 7 of 15
7. Question
What is the output of the following code in python?
# Code Snippet StartvalStr = ‘ You are at QuizOrbit ‘
print(len(valStr))#Code Snippet End
CorrectIncorrect - Question 8 of 15
8. Question
Guess the output of the following code:
# Code Snippet Startstatement = ‘Aandy works at QuizOrbit’
statement[0] = ‘C’
print(statement)#Code Snippet End
CorrectIncorrect - Question 9 of 15
9. Question
What is the output of the following code?
# Code Snippet Startstring = ‘Honesty is the best policy.’
position = string.find(‘esty’)
print(position)#Code Snippet End
CorrectIncorrect - Question 10 of 15
10. Question
What is the output of the following code?
# Code Snippet Startstringval = ‘QuizOrbit-User Login’
val = stringval.split(“-“)
print(len(val))#Code Snippet End
CorrectIncorrect - Question 11 of 15
11. Question
Find the output of the given code?
# Code Snippet Start
org = ‘QuizOrbit’
val = 0
for i in org:
val+=ord(i)
print(val)
#Code Snippet End
CorrectIncorrect - Question 12 of 15
12. Question
Find the output of the following code?
# Code Snippet Start
fruit = [‘apple’, ‘banana’, ‘pear’]
print(fruit[1].count(‘a’))
#Code Snippet End
CorrectIncorrect - Question 13 of 15
13. Question
Find the output of the below code?
# Code Snippet Start
statement = ‘Python is the BEST’
for i in statement.split(” “):
if(i.isupper()):
print(i.lower(),end=” “)
elif(i.islower()):
print(i.upper(),end=” “)
else:
print(i,end=” “)
#Code Snippet End
CorrectIncorrect - Question 14 of 15
14. Question
What will be the output of the following code?
# Code Snippet Start
val1 = ‘Honesty is the best policy.’
val2 = ‘Honesty is the jewel of few.’
if (val1>val2):
print(“One wins!”)
elif(val1<val2):
print(“Two wins!”)
else:
print(“Both are similar!”)
#Code Snippet End
CorrectIncorrect - Question 15 of 15
15. Question
Find the output of the code given below?
# Code Snippet Start
val1 = ‘QuizOrbit’
val2 = ‘quizorbit’
if val1>val2:
print(val1)
elif(val2>val1):
print(val2)
else:
print(‘Exit!’)
#Code Snippet End
CorrectIncorrect
Summary
Python strings are immutable in nature and this might have become quite clear with the concepts we checked in the quiz above. Also, don’t forget to share the quiz among your friend’s so that none misses out on learning and the fun doubles.
this question is wrong please check the question first
question number 11 is wrong please review it
question 10 how it comes 2 ???
Can anyone explain me the question no. 15 ?
Good learning with Dataflair.
its good
Q5- Wrongly worded, Its saying each character not saying each first letter of word, ans find() wrong as per question