B03D-2017 – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-CBSE12A-2017-B03D #PYTHON#6249    siteicon   siteicon  

Problem Statement - B03D-2017

Write definition of a Method MSEARCH(STATES) to display all the state names
from a list of STATES, which are starting with alphabet M.
For example:
If the list STATES contains
[“MP”,”UP”,”WB”,”TN”,”MH”,”MZ”,”DL”,”BH”,”RJ”,”HR”]
The following should get displayed
MP
MH
MZ

Solution

TC++ #6249

def MSEARCH(STATES):
    for i in STATES:
        if i[0]=='M':
            print i


Share

CSKC| Created: 10-Jan-2019 | Updated: 10-Jan-2019|CBSE12A-2017









Back