1

I want user to input a name of a table, table = str(input("table: ")) works, but it's kind of annoying to put 'name' everytime instead of just name, is there any work around for this?

CinCout
  • 9,486
  • 12
  • 49
  • 67
chenchen
  • 49
  • 3
  • 6
  • http://stackoverflow.com/questions/4915361/whats-the-difference-between-raw-input-and-input-in-python3-x – Suku May 24 '16 at 04:06

1 Answers1

3

Use raw_input:

table = raw_input("table: ")

>input([prompt])

Equivalent to eval(raw_input(prompt))

This function does not catch user errors. If the input is not syntactically valid, a SyntaxError will be raised. Other exceptions may be raised if there is an error during evaluation.

If the readline module was loaded, then input() will use it to provide elaborate line editing and history features.

Consider using the raw_input() function for general input from users.

Usman Maqbool
  • 3,351
  • 10
  • 31
  • 48
Hackaholic
  • 19,069
  • 5
  • 54
  • 72