Quiz on String Manipulation in Python
Q.1. Select the correct output of the following String operations
strOne = str("HFC")
strTwo = "HFC"
print(strOne == strTwo)
print(strOne is strTwo)
Q.2. Select the correct output of the following String operations
x = 'abcd'
for i in x:
print(i.upper())
Q.3. What is a string?
Q.4. Select the correct output of the following String operations
s = 'foo'
t = 'bar'
print('barf' in 2 * (s + t))
Q.5. Which method should I use to convert String "welcome to the beautiful world of python" to "Welcome
To The Beautiful World Of Python"
To The Beautiful World Of Python"
Q.6. What will be the output of the following Python statement?
print("a"+"bc")
Q.7. What is the output of the following string operations?
str = "My salary is 7000";
print(str.isalnum())
Q.8. What is the result of this statement?
print(ord('foo'))
Q.9. For strings, the symbol '+' means
Q.10. Method issubclass() checks if a class is a subclass of another class.
Q.11. What will be the output of the following Python code?
print("abc. DEF".capitalize())
Q.12. What will be the output of the following Python code?
str1 = 'Welcome'
print (str1[:6] + ' HFC')
Q.13.Which function is called when the following Python program is executed?
f = foo()
format(f)
Q.14. What is the output of the following code?
x="BOnvoyage"
print(x[3: ])
Q.15. What is the output of the following code?
print('*', "abcde".center(6), '*', sep='')
Instructions:-
- This Quiz is based on String Manipulation in Python
- Each correct answer will carry 2 points
- Once an option is selected you cannot select any other, So choose wisely
- Do not refresh the page as it will reset the quiz
- Once the time is up the quiz will automatically get submitted with no of Question responded
- Your total score alongwith your name will be shown after submission of the Quiz
- Wish you ALL THE BEST 👍👍
START
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP