How many times the word 'HELLO'is printed in the following statement
s=' python rocks'
for ch in s(3:8):
Printed hello
Answers
Answer:
5 times
Explanation:
for ch in s[3:8]:
Here the loop runs from 3 to 7 ,i.e., 5 times.
So Hello will be printed 5 times.
Note: ch is just a variable and not a keyword. So don't confuse that from [3] to [7] there are only 4 characters. The space is also counted.
5 since, 3 to 8 is 5 times.
Explanation:
An array is described as an ordered set of comparable records objects.
The factors of an array are of identical records kind and every object may be accessed by the use of the identical name.
The array is a series of a constant wide variety of additives (factors), in which all of the additives have identical records kind.
One-dimensional array: array wherein additives are organized in listing form. Multi-dimensional array: array wherein additives are organized in tabular form (now no longer covered)