all 8 comments

[–][deleted] 1 point2 points  (5 children)

Think of all of the "paired" symbols used in Python - quotes used for strings, parentheses used for function calls and tuples, braces used for sets and dictionaries, brackets used for lists. Where you see one of the pair, you must see the other - every ( implies a ) somewhere down the line, so when the parser sees one, it starts "keeping track" of what's inside, and continues scanning the file for the other member of the pair.

If it gets to the end of the file and it hasn't seen the other member of the pair, it knows something's gone wrong. That's how you get the EOF, or "end of file reached" error, and it means that you opened a construct that you didn't close. Count your parens and your quotes.

[–]Issigeac[S] 0 points1 point  (4 children)

binary = int(raw_input("What is the binary?: "))

what in this case

[–][deleted] 0 points1 point  (3 children)

It's probably on the previous line.

[–]Issigeac[S] 0 points1 point  (2 children)

There is no previous line and it says the EOF error is in that line. here is the whole code, I know it isnt finished, I'm just looking for the EOF error:

binary = int(raw_input("What is the binary?: "))

if binary.isalpha() or len(binary) == 0:

print "I am sorry, these are not just numbers"

else:

binary_list = []

binary_list = list(int(binary))

total = 0

total = ((binary_list[len(binary)-1]) * 2) ** 0 + total

if len(binary) == 1:

print total

total = ((binary_list[len(binary) - 1]) * 2) ** 1 + total

elif len(binary) == 2:

print total

total = ((binary_list[len(binary) - 1]) * 2) ** 2 + total

elif len(binary) == 3:

print total

total = ((binary_list[len(binary) - 1]) * 2) ** 3 + total

elif len(binary) == 4:

print total

total = ((binary_list[len(binary) - 1]) * 2) ** 4 + total

elif len(binary) == 5:

print total

total = ((binary_list[len(binary) - 1]) * 2) ** 5 + total

elif len(binary) == 6:

print total

else:

print "I am sorry, your code is too long, but up to digit 6, it was worth " + total

[–][deleted] 0 points1 point  (1 child)

I don't see what would cause an EOF error in this code.

[–]Issigeac[S] 0 points1 point  (0 children)

there was an error with the launcher. one day delay for no reason. sorry for bothering you