0

Syntaxly is correct but it will not undergo for loop

Need a exact description

7th Dec 2020, 2:14 PM
Ajith
Ajith - avatar
16 odpowiedzi
+ 1
Maybe ur trying to print something that you didn't even define Try this to print hi y = "hi" for x in y: print (x)
8th Dec 2020, 10:44 PM
Web Sad
Web Sad - avatar
0
for value in " ": print("Hi")
7th Dec 2020, 2:15 PM
Ajith
Ajith - avatar
0
Well, the string " " only contains one character, (a space). As such, your loop goes around once only. Is this your doubt or is there something else?
7th Dec 2020, 2:21 PM
Ipang
0
It will not undergo for loop
7th Dec 2020, 2:26 PM
Ajith
Ajith - avatar
0
Hey you already said that undergo thing in the title. And I'm still not getting what you mean. I checked that code and it works, in case you wonder.
7th Dec 2020, 2:28 PM
Ipang
0
Its prints hi ??
7th Dec 2020, 2:33 PM
Ajith
Ajith - avatar
0
It prints nothing
7th Dec 2020, 2:33 PM
Ajith
Ajith - avatar
0
It prints "Hi" One time ...
7th Dec 2020, 2:37 PM
Ipang
0
No way. I have checked it more than 10 times.check the indentations also
7th Dec 2020, 2:38 PM
Ajith
Ajith - avatar
0
What you saying that I'm lying? Copy the first comment above, paste in Code Playground and run You'll see I'm not telling lie ...
7th Dec 2020, 2:41 PM
Ipang
0
I can't share screenshot here that's problem
7th Dec 2020, 2:42 PM
Ajith
Ajith - avatar
0
Anyway thanks!!
7th Dec 2020, 2:42 PM
Ajith
Ajith - avatar
0
Ok no problem ...
7th Dec 2020, 2:44 PM
Ipang
0
I don't leave space in between those ""
7th Dec 2020, 2:44 PM
Ajith
Ajith - avatar
0
Look again in your first comment above ... for value in " ": # <- one space string print("Hi")
7th Dec 2020, 2:57 PM
Ipang
0
Read my question again web sad
15th Dec 2020, 7:23 AM
Ajith
Ajith - avatar