First page Back Continue Last page Overview Graphics

input(): Differences Python 2 and 3

Python2

input()

Input is evaluated

raw_input()

Input is taken as a string

Python3

eval(input())

Input is evaluated

input()

Input is taken as a string

Python2:

name = raw_input("What's your name: ")

print("Your name is " + name)

Python3:

name = input("What's your name: ")

print("Your name is " + name)