2017-04-13 3 views
-1

i écrit le code suivant, mais au cours de lancer sa donne erreur de nom « raw_input » s'il vous plaît aidez-moi à sortir de cetteComment je PROVIENNENT avec erreur de nom en python

mon code est: fname = raw_input('enter a file name: ') print (fname)

erreur est = erreur de nom: nom « raw_input'is définit pas

+0

Vous utilisez Python 3, où' raw_inp ut' a maintenant été changé en simplement 'input' –

+0

On dirait que vous utilisez Python 3 où' raw_input' n'existe pas. Remplacez-le par 'input' ou revenez à Python 2. – Matthias

Répondre

0

raw_input sur python 3+ est maintenant juste input()

fname = input('Enter a file name: ') 
print(fname)