How many times is the word ‘ADITYA’ printed in the following statements?
S='RATHEESH BARATHI'
for ch in S[3:10]:
print(‘ADITYA’)
Answers
Answered by
3
The word will be printed 7 times.
S[3:10] is a slice of 7 characters so the loop will run 7 times.
Similar questions