0
How does the following code work?
for i in range(5): print("hello")
6 Respuestas
+ 1
"i" is just a variable, so yes. It can be substituted for any other string you'd like.
+ 1
Python is a language where you don't have to define 'i' before using it in the for loop. So assuming you aren't defining any other variable, you can substitute 'i' with any variable that is not critical to the program logic.
0
easy print works like this...print ("Hello World ") then you run it and I should say the following..... Hello World
0
Still confused about how the for i in range(argument) function works
0
I understand the range part properly
Can the i be substituted with any other string or does it have to be i?
0
Thanks everyone ☺