Q. How many times is the word 'HELLO' printed in the following statement?
s = "python rocks"
for ch in s:
print("Hello")
Answer :-
For loop will run len(s) times. So “hello” print will print 11 times.
Answer :-
For loop will run len(s) times. So “hello” print will print 11 times.
It's wrong as Len would be 12
ReplyDeleteNo len would be 11
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )