On This Page

This set of Problem Solving and Python Programming Multiple Choice Questions & Answers (MCQs) focuses on Problem Solving And Python Programming Set 24

Q1 | To concatenate two strings to a third what statements are applicable?
Q2 | >>>chr(ord('A'))
Q3 | >>>print(chr(ord('b')+1))
Q4 | Which of the following statement prints hello\example\test.txt?
Q5 | Suppose s is “\t\tWorld\n”, what is s.strip()?
Q6 | The format function, when applied on a string returns                        
Q7 | +2+3?
Q8 | >>>print("A", end = ' ')
Q9 | What will be displayed by print(ord(‘b’) – ord(‘a’))?
Q10 | Say s=”hello” what will be the return value of type(s)?
Q11 | What is “Hello”.replace(“l”, “e”)?
Q12 | To retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)?
Q13 | To return the length of string s what command do we execute?
Q14 | If a class defines the     str    (self) method, for an object obj for the class, you can use which command to invoke the     str      method.
Q15 | To check whether string s1 contains another string s2, use                  
Q16 | Suppose i is 5 and j is 4, i + j is same as
Q17 | print(id(s1) == id(s2))
Q18 | What function do you use to read a string?
Q19 | ))
Q20 | ), '*')
Q21 | ), '*', sep= '')
Q22 | , 1))
Q23 | , '1'))
Q24 | , '12'))
Q25 | ))