python - What's wrong here? Trying to write results of this function into file -


def pryklad (b):     a=1      while < 10:         print a*b         a=a+1  if __name__=="__main__":     pryklad(3)     a=pryklad(3)     value=str(a)     file=open('c:/python27/file.txt','w+')     file.write(value)     print file   

a = pryklad(3) results in a being none, because don't have return statement in function. prints numbers. also, i'm not sure suppose print file.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -