[Tutor] How can I make this run right?

Alan G alan.gauld at freenet.co.uk
Mon Aug 15 10:20:21 CEST 2005

> The following code is supposed to take in a number, and print 
> number!:
> n = int(raw_input("Number: "))
> x = n-1
> while 1:
>    t = n*x
>    while x > 1:
>        x -= 1
>    else:
>        break
> print t
> Why isn't it working, and how can I make it print out the correct 
> output?

So give is a clue! What is it doing wrong? Is there an error message?
What output did you expect? What did you get?

Without that information we have to read the code and guess what you
were trying to do. Then try to guess what might be different to what
you expected.

Alan G. 

More information about the Tutor mailing list