Hey please help me execute this SIMPLE While LOOP in Python 3


I had a question that what would we write (using while loop only) to “input 10 numbers from the user and then output how many of the numbers were less than 0 i.e negative?” I used this sort of program. im getting different errors. If I do it this way it says "Break after Loop". If I put x+=1 after the y= thingy I get some other error. Please help me.

while (x<10):
     y= int(input("Number please: "))
if (y<0): c+=1


why do you even have a break? I don't see why you would need it

as for this two lines:

if (y<0): c+=1

i would place them inside the loop (change the indention)


Thank you so much man. Love you for that <3. Actually im new learning python so I was a little unsure about the indentation in loop thing. Now i understand


everything working as it should now?


Yes it is working perfectly.


A post was split to a new topic: Help with homework


I choice to help you with a problem you where facing, but i don't feel like helping you with all your homework assignments. I split the topic, now someone else can answer if they feel like it.


Tysm bro. Done. I understand it now.