QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A CBSE12A-2017-B01C #6216

Question:

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

STRING=""WELCOME
NOTE""
for S in range[0,8]:
    print STRING(S)
print S+STRING

Answer:

STRING= "WELCOME"
NOTE=""
for S in range (0,8) :
    print STRING [S]
print S,STRING

Also range(0,8) will give a runtime error as the index is out of range. It should
be range(0,7)