0

Can anyone tell me how this is a loop ? >>> print('Hello world!') Hello world! >>> print('Hello world!') Hello world! >>>

As the basic feature of loop is to repeat anything given in the print field as long as the condition is true or false.

25th Jul 2017, 5:05 AM
Ramesh
Ramesh - avatar
3 Antworten
+ 11
This doesn't look like a loop. You are just typing your code twice. A loop requires a loop structure, e.g. x = 0 while x < 2: print('Hello World') x += 1 #This is a loop which runs twice.
25th Jul 2017, 5:12 AM
Hatsy Rei
Hatsy Rei - avatar
0
You didn't use any type of loop structure, so therefore it is not a loop at all.
28th Jul 2017, 1:08 AM
Wolfy Mountain
Wolfy Mountain - avatar
0
It's flowchart Boolean loop condition balong my English not good but try to understand this code just think you have to number (4) and (5) and code work like that if 4 < 5: print ("hello world") else: print (false) OK so this is loop but not while loop or def loop it's just normal if condition loop create flowchart and you learn batter I hop this will help you
15th Aug 2017, 5:59 PM
Suraj Maurya
Suraj Maurya - avatar