By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

Function raw_input usage

P: n/a
How does raw_input function work in general?
Nov 4 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 2,851
Function raw_input returns a string. Technically, raw_input reads a line of input from standard input (sys.stdin) and returns a string. If a prompt string is supplied, it is first printed to standard output (sys.stdout). Trailing newlines are stripped. If an EOF is read, an EOFError is raised.

Expand|Select|Wrap|Line Numbers
  1. s = raw_input("What is your name?")
  2. print "Your name is %s." % (s)
Nov 4 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.