I cant understand the EOF error. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I cant understand the EOF error.

#Rock,Paper and Scissor game. #Enjoy... P1_Score=0 P2_Score=0 while True: P1=input("Rock,paper or scissor: ").title() P2=input("Rock,paper or scissor: ").title() if P1=="Rock" and P2=="Paper": print("P2 gets a point ") P2_Score=P2_Score+1 elif P1=="Paper" and P2=="Rock": print("P1 gets a point") P1_Score=P1_Score+1 elif P1=="Scissor" and P2=="Rock": print("P2 gets a point") P2_Score=P2_Score+1 elif P1=="Rock" and P2=="Scissor": print("P1 gets a point") P1_Score=P1_Score+1 elif P1=="Paper" and P2=="Scissor": print("P2 gets a point") P2_Score=P2_Score+1 elif P1=="Scissor" and P2=="Paper": print("P1 gets a point") P1_Score=P2_Score+1 elif P1=="Rock" and P2=="Rock": print("It's a TIE") elif P1=="Paper" and P2=="Paper": print("It's a TIE") elif P1=="Scissor" and P2=="Scissor": print("It's a TIE") elif P1=="Q" or P2=="Q": print("The score of P1 is ",P1_Score) print("The score of P2 is ",P2_Score) if P1_Score>P2_Score: print("Player1 Wins") elif P1_Score<P2_Score: print("player 2 Wins") elif P1_Score==P2_Score: print("It's a TIE") break else: print("invalid input") continue Here this codes run good in VS code. But in solo learn code playground it shows EOF error.why?? Please help me!!

16th Nov 2020, 12:25 PM
Tanvir
Tanvir - avatar
3 Answers
+ 1
Because you have to give all inputs at the same time. And you have given only one input.
16th Nov 2020, 12:31 PM
Deep Kr. Ghosh
Deep Kr. Ghosh - avatar
0
Check this code for SoloLearn playground input behaviour. it shows how to input to console in Sololearn. Hope it helps you understand SoloLearn console behaviour.. https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
16th Nov 2020, 1:40 PM
Jayakrishna 🇮🇳
0
So I don't have full freedom regarding inputs. I understood.Thank you.
16th Nov 2020, 3:26 PM
Tanvir
Tanvir - avatar