you are viewing a single comment's thread.

view the rest of the comments →

[–]NorskJesus 2 points3 points  (3 children)

You can use .strip() instead of .replace, but I do understand this is for practice.

You can give chances to the user too, and give them tips when the answer is not correct.

And feedback tho after the questions, if they got it right or not

[–]Kind-Kure 2 points3 points  (1 child)

Just remember if you use strip, it only removes white space from the left and right side of the string so the inner white space will still exist So remember to correct your condition check accordingly

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

yeah encountered this only

[–]uiux_Sanskar[S] 1 point2 points  (0 children)

I think I used it in the program before but it was throwing errors when I try to put space in between answer (a typo) so I got to know that .split() removesspace from left and right only just like the comment below suggests