EOf error

what is an eof error i keep getting even though my code is perfectly fine?
i tried searching about it but i couldn’t find a solution.

var = None #function1 adds stuff def function1(): global var input1 = input("enter number") input2 = input("enter a number") var = int(input1) + int(input2) #function2 prints stuff def function2(): print(var) function1() function2()

It signals a non-terminated or indefinite data stream. Codebytes are extremely buggy and should not be used to take user input. Use a REPL.IT or other sandbox for reliable demos. There is a new sandbox soon to arrive on the dashboard of users, but I have no specific details nor roll out date. Just something we heard recently.

var = None def function1(): global var a, b = 6, 7 var = a + b def function2(): print(var) function2() function1() function2()

What we’ve done is simulate user input. To test different values we need to edit the source code or generate random numbers.

For demonstrating code that takes no user input, Codebytes is reliable, if a bit slow, so I shouldn’t say it is extremely buggy. The bugginess is with its refusal to accept user inputs, but I expect that is more security constraint, and nothing more.

2 Likes