Greetings! I got stuck at an exercise from the book learn python the hard way about raw_input function.(exercise 11.2)
After reading from docs.python.org I found out that this function can perform standard output without a trailing newline.Also it can take an input line, convert it as a string( stripping a trailing newline) and return it. The exercise question is : Can you find other ways to use it? Here is the original code from the book: print "How old are you?", age = raw_input() print "How tall are you?", height = raw_input() print "How much do you weigh?", weight = raw_input() print "So, you're %r old, %r tall and %r heavy." % ( age, height, weight) Now, the only different way I was able to use raw_input is: age = raw_input("How old are you? ") height = raw_input("How tall are you? ") weight = raw_input("How much do you weigh? ") print "So, you're %r old, %r tall and %r heavy." % (age, height, weight) Are there any other ways of using it? If yes can you please give me a detailed example so I can understand. Thanks in advance, amt.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor