"Raven Of Night Raven Of Night" <[EMAIL PROTECTED]> wrote

>    print "Guesses you've taken: ",i, "\nGuess letter: "
>    letter_guess = raw_input()'
>
>
> this is a line of my program, and raw_input only takes one argument.

Yes, and that argument is the prompt to display to the user, which
is what you want...

letter_guess = raw_input('Guess letter. ')

> is there a way to continue the input line, like in java you would 
> just do
> System.out.print?

As to simulating Java's print style, yes, there are a couple of ways.

1) put a comma at the end of the string to be printed:

print 'hello ",
print 'world'

prints
hello world

2) use sys.stdout.write()

sys.stdout.write('hello ')
sys.stdout.write('world')

3) use string formatting to create the string before printing

outstring = "%s %s %" % (var1,var2,var3)

It all depends what you are trying to do which one suits best...

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to