"C M Caine" <[email protected]> wrote
That's an easy mistake to make. Simply use raw_input instead of input. The former will always return a string, the latter treats whatever you enter as executable python code.
Whilst I agree with the general principle to use raw_input, I don't see how we can say that it is the problem here. Indeed so far as I can tell we don't even know what the problem here is other than that the OP is trying to call the function he has defined in another file. -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ On 13 March 2010 18:56, Marco Rompré <[email protected]> wrote:
Hello I have a little problem, I am trying to define a function ligneCar(n, ca) that would print n times the caracters ca.For now I have the user entering a short sentence corresponding to ca. Here is my code: def ligneCar(n,ca): c=0 while c<n: print ca c+=1 ca = input ('Enter a short phrase : ') n = input ('Enter how many times you want : ') Thats the definition of my function ligne_Car then in another python file I want to recall my function ligne_Car but it is not working. Please help me
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
