0

i am getting error in sololearn code playground

it is my code and its working fine in vs code and python ide but here in sololearn codeplayground im getting eof error like below [ Traceback (most recent call last): File "file0.py", line 14, in <module> item = input("add item: ") EOFError: EOF when reading a line ] can anyone help i wan to upload it here in sololearn user_input = "xyz" data = [] def menu(): print("1. for adding a item to list") print("2. for item done") print("3. for view item ") print("4. for exit") while user_input != "4": menu() user_input = input("What you want to do: ") if user_input == "1": item = input("add item: ") data.append(item) print("item added to list") elif user_input == "2": item = input("what is done: ") if item in data: data.remove(item) else: print("item does not exist in list") elif user_input == "3": print("your list is : ", data) elif user_input == "4": print("Good byeee") else: print("Please type from 1 to 4: ")

7th Jan 2022, 7:15 AM
Paresh Vinzava
Paresh Vinzava - avatar
3 Answers
+ 5
Code Playground doesn't support interactive input/output. Your code requires interactive input support (for the menu). Next time please, save your code in SoloLearn and share its link in your post Description ☝ https://www.sololearn.com/post/75089/?ref=app Your code may be truncated due to character limits if it's large and you post it as raw text format
7th Jan 2022, 7:53 AM
Ipang
+ 1
Okay, thank you tashi for guidance
7th Jan 2022, 7:57 AM
Paresh Vinzava
Paresh Vinzava - avatar
+ 1
I think this code could help you: try: item = input() except EOFError: break # or other pieces of code
7th Jan 2022, 9:26 AM
SoloProg
SoloProg - avatar