Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Why do i get a EOFError with this Python Code?

This is my code:

user1 = "John Smith"

rank1 = "Colonel"

joined1 = "N/A"

user2 = "Jack Smith"

rank2 = "Captain"

joined2 = "Apr 19, 2014"

user3 = "Dexter Smith"

rank3 = "Major"

joined3 = "Apr 21, 2014"

var = var_input("Please enter the first name of your target: ")

if var == "John Smith":

print "Name: %s" % user1

print "Rank: %s" % rank1

print "Date Joined: %s" % joined1

if var == "Jack Smith":

print "Name: %s" % user2

print "Rank: %s" % rank2

print "Date Joined: %s" % joined2

if var == "Dexter Smith":

print "Name: %s" % user3

print "Rank: %s" % rank3

print "Date Joined: %s" % joined3

It relies on user input with raw_input. But i keep getting an EOF Error for rar_input? Why is this?

1 Answer

Relevance
  • 7 years ago

    Are you using Python 3.x? If so, use input() instead of raw_input()

Still have questions? Get your answers by asking now.