Why does entering wrong value in code is not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does entering wrong value in code is not working

https://code.sololearn.com/c9du7KjrrDZN/?ref=app

4th Oct 2020, 7:02 AM
Prashant Pandey
Prashant Pandey - avatar
14 Answers
4th Oct 2020, 7:47 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 3
If u will Enter other characters like a,b,c,D etc then loop will run infinite times . but if u enter x,X or o ,Othen working properly
4th Oct 2020, 8:37 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 2
Thanks
4th Oct 2020, 8:48 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
But still its priting the output as: the positions of TIC TAC TOE for players reference: ____________________ |pos[1]|pos[2]|pos[3]| |______|______|______| |pos[4]|pos[5]|pos[6]| |______|______|______| |pos[7]|pos[8]|pos[9]| |______|______|______| player1 enter X or O:e invalid choice player1 enter X or O:invalid choice player1 enter X or O:
4th Oct 2020, 7:16 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
Why is invalid choice printed 2 times
4th Oct 2020, 7:16 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
♨️♨️ still not working
4th Oct 2020, 8:33 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
If i am giving any alphabet other than X,x,O,o then
4th Oct 2020, 8:35 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
i have given the output above its still aski g for input but is printing invalid 2 times
4th Oct 2020, 8:39 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
Run my program again and enter any chars a,b,c,D,E i updated
4th Oct 2020, 8:41 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
But i dont want to terminate it i want to ask the player till it enters x or o
4th Oct 2020, 8:44 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
Then you have to make function and where i used break call your function here then it will ask again for inputs . When u make any big program divide your code in functions.
4th Oct 2020, 8:46 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Ok
4th Oct 2020, 8:47 AM
Prashant Pandey
Prashant Pandey - avatar
+ 1
Because it isn't understandable by the computer . Like when you don't know something you say it is wrong but for a computer which has been programmed to know almost everything it will say it is wrong.
4th Oct 2020, 4:48 PM
Augustine
Augustine - avatar
0
What you input u giving
4th Oct 2020, 8:34 AM
A S Raghuvanshi
A S Raghuvanshi - avatar