String MCQ
String MCQ
a) +
b) –
c) *
d) All of the mentioned
a) Know
b) Know Program
c) Know Python
d) None of these
a) True
b) False
a) s.len()
b) len(s)
c) size(s)
d) s.size()
5.Which method should I use to convert String “Python programming is fun” to “Python
Programming Is Fun”?
a) capitalize()
b) title()
c) istitle()
d) upper()
a) 7
b) 2
c) 2, 7
d) None of these
8.How would you extract 'World' from the string 'Hello, World!'?
a) 'Hello, World!'[7:11]
b) 'Hello, World!'[6:11]
c) 'Hello, World!'[7:12]
d) 'Hello, World!'[6:12]