Page 287 - Computer Science Class 11 Without Functions
P. 287
1. Assertion(R): Python allows a string literal to span multiple lines.
Reasoning(R): A multiline string is enclosed between triple single quotes or triple double quotes.
2. Assertion(A): First character in a string is at index 0, the next is at index 1, and so on.
Reasoning(R): For any non-empty strings, s[len(s)-1] and s[-1] both return the last character.
Case Based Questions
1. Every email address consists of three parts - unique id, '@', and domain name. For example, in the email-id
rknararayan@bbpspp.co.in, rknararayan is the unique id, and bbpspp.co.in is the domain name.
Write a Python program that accepts a list of email ids and counts the number of email ids having the domain gmail.com
2. Rashmi knows that a number can be converted to string using the function str() and a string can be converted into an
integer using int(). She wants to work with strings (comprising alphabets, digits, and special characters ) as user input.
She wants to determine the number obtained on ignoring the non-digit characters. Once she gets the number, she wants
to square it up. Help Rashmi in writing a Python program that achieves this.
Multiple Choice Questions
1. (c) 2. (d) 3. (b) 4. (a) 5. (d) 6. (d) 7. (a) 8. (b) 9. (d)
10. (c) 11. (b) 12. (a) 13. (c) 14. (b) 15. (a) 16. (d) 17. (b) 18. (a)
True or False
1. (F) 2. (F) 3. (T) 4. (F) 5. (T) 6. (F) 7. (F)
Fill in the blanks
1. str 2. backslash (\) 3. index 4. len () 5. str() 6. slice
7. s 8. title()
Strings 285

