='0' and s1[i]<='9': Num=int(s1[i]) Num−=1 s2=s2+str(Num) elif s1[i]>='A' and s1[i]<='Z': s2 - Computer Science (Python) | Shaalaa.com" />='0' and s1[i]<='9': Num=int(s1[i]) Num−=1 s2=s2+str(Num) elif s1[i]>='A' and s1[i]<='Z': s2 " />='0' and s1[i]<='9': Num=int(s1[i]) Num−=1 s2=s2+str(Num) elif s1[i]>='A' and s1[i]<='Z': s2" />
मराठी

Predict the output of the following Python code: s1="SQP−25" s2="" i=0 while i<len(s1): if s1[i]>='0' and s1[i]<='9': Num=int(s1[i]) Num−=1 s2=s2+str(Num) elif s1[i]>='A' and s1[i]<='Z': s2 - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Predict the output of the following Python code:

s1="SQP−25"
s2=""
i=0
while i<len(s1):
  if s1[i]>='0' and s1[i]<='9':
     Num=int(s1[i])
     Num−=1
     s2=s2+str(Num)
  elif s1[i]>='A' and s1[i]<='Z':
     s2=s2+s1[i+1]
  else:
     s2=s2+'^'
    i+=1
print(s2)
अति संक्षिप्त उत्तर
Advertisements

उत्तर

QP-^14

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2025-2026 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×