[Tutor] Problem with little program

Alan Gauld alan.gauld at btinternet.com
Sat Mar 13 20:34:13 CET 2010


"Marco Rompré" <marcodrompre at gmail.com> wrote

> 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

The bottom two lines are not part of the function, they will
be executed when you import the file - is that really what you wantr?

> then in another python file
>
> I want to recall my function ligne_Car but it is not working.

So show us the code that is not working!
How are you importing the function? How are you accessing it?
What error message do you get, if any?
What happens?

> Please help me

Please help us.
We can't possibly guess what you might be doing wrong
with no clues.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 




More information about the Tutor mailing list