QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A CBSE12A-2016-B01C #6271

Question:

Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.

for Name in [Ramesh,Suraj,Priya]
    IF Name[0]='S':
        print(Name

Answer:

for Name in [ " Ramesh " , " Suraj " , " Priya " ] : // ' ' can be used
    if Name[0] == 'S':
        print(Name)