+ 4
Find error
Guys..give some special characters and find error. it prints 3 times...can anyone help me out... https://code.sololearn.com/cQyFb5lHmg2C/?ref=app
9 Answers
+ 2
Hey I found it!
Actually it's not an error, but still
It just checks for every character in an input whether it is letter or not and prints the else message as many times as the number of non-alphabetical characters in your input
So if you want it to print the message once and terminate than you have to make a separate loop/sub-routine checking for improper characters in an input.
If smthng found - terminate
else - run the main part
Hope you'll be able to make it yourself ;)
+ 8
I find it prints just fine. Can you give a example?
+ 8
if you want it to stop after the special character detect, just place a exit() after the print on else. that'll stop the message being displayed multiple times
+ 2
@Ahri @chaocti when you give special characters or numbers it prints else statment two times....check onceđ
+ 2
I only get once for each special character. If you are getting more than one close the playground/app, reopen it and try again.
+ 2
give more characters and check
+ 2
It works fine. It prints the else statement for each character that isn't in [a-z] [A-Z][. ].
+ 1
Yup, still working fine
+ 1
@chaotic bro i can't do anything.... check @dinmukhamed comment