Pythonic Algorithms 101


i think i have the code right, but it prints none, help!!!

i = 0
while True:
  i += 1
  if i == 100: 
print i

op is



i put your code here:

there is no None, where do you get None?



it prints 100 then none on the screen


But where are you running the code? Because i posted the repl, and there was no None, so it seems to be environment depended.

i understood from your first reply you get none in the output, but you need to help me narrow down the problem



i sent in an image, please look to the right in the image, in the black square, you’ll see:


I don’t know, but the none is bieng printed


What you are running is the old learning environment, which is no longer supported and maintained, so the whole exercise could be bugged.

The none is very likely caused by the exercise validation (SCT)

i would recommend the supported python course:

Given you take such an outdated course, can you share me the url? Maybe i can have a look


i’m usu a few days late a few dollars short, really sorry to be a bother to you, thanks for helping me…


i know what the problem is, CA wants me to spend money on their courses, i simply cannot afford to continue,

stetim94- I sincerely appreciate your helping me, but, please don’t put any more of your time into this thread.




but this course:

is free

so why can’t you take that course?


I checked, I did take this course, great course, I can’t afford to continue, it’s a CA biz model of give people a taste of what CA can do, namely this course, but then, CA will ask for monthly payments to continue


Well, the free tier is the regular lessons (this has always been), then later pro was added (paid tier) which included quizzes and freeform projects


it seems the loop needs to end at zero, so you could go from 100 to 0 for example


i = 100
while True:
i -= 1
if i == 0:

print i

yo! stetim94, it worked?? i still got 0,none, but it passed through, imagine that, thanks for the help!!! if one can afford CA pro, IMO this is the way to go, CA offers some great classes and amazing people as yourself… i don’t begrudge paying for CA courses, I simply do not have the funds to go pro—


Yea, the none is caused by the exercise validation. Nothing to worry about

well, you print i, so obviously you get the value of i (which is zero)


Yep!! thanks again for the help, have a great day