Weird r error that I have | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Weird r error that I have

I was coding for a code coach, the code coach needed me to print an asterisk (*) corresponding to the imputed number. Bu then I got an error that says that there's something wrong in the print("*") part of my code, can someone fix this? https://code.sololearn.com/cjdQ3AbZztX1/?ref=app

19th Mar 2023, 7:39 AM
RayZ
RayZ - avatar
5 Answers
+ 4
Remove the non-displayable character between line 9 and 13. It happens when you copy code from somewhere else or accidentally type it on the keyboard.
19th Mar 2023, 9:25 AM
Lisa
Lisa - avatar
+ 3
RayZ This seems to be the second question you posted with a similar problem. If you are copy-pasting the code from somewhere else, check if you have a "paste as plain text" option when pasting. Your source seems to be adding non-printable characters to the code. The R code you are posting seems simple enough. I was wondering why not just code them directly in Sololearn?
19th Mar 2023, 11:37 AM
Bob_Li
Bob_Li - avatar
+ 1
Thanks Lisa it worked!
19th Mar 2023, 9:34 AM
RayZ
RayZ - avatar
+ 1
Bob_Li I didn't copy them from somewhere, I just coded them on sololearn. So.... Maybe my keyboard is the problem?
19th Mar 2023, 3:11 PM
RayZ
RayZ - avatar
+ 1
yes, or maybe in the language settings. or maybe tabs are not converted to spaces.
19th Mar 2023, 5:34 PM
Bob_Li
Bob_Li - avatar