+ 5

"/../Playground/" unexpected in code

I was looking at one of my old codes (https://code.sololearn.com/cwm94X98fI1X/?ref=app) and decided to change the "sep" variable to "/" just to see what would happen. And instead of each letter being separated by a slash, which is what would happen with any other character, the output replaces the letters with "/../Playground/"! What’s going on??

23rd Apr 2021, 2:24 PM
McInventor29
McInventor29 - avatar
5 odpowiedzi
+ 4
Hi McInventor29, for some reason, the SoloLearn python code playground is giving an error of ".../Playground/" whenever we try to print or concatenate any form of these patterns: print('/E/L/E') # O/P: .../Playground/ print('/a/b/c') # O/P: .../Playground/ I tried to run your in other platform it's working super fine even with sep='/' (I use Dcoder to run and it's works fine) Maybe, the ".../Playground/" error is because SoloLearn interpretation uses/works on some other server/web interpretator(and not on a real environment). And for some reason "/a/b/c" happens to be some kind of the file path(oh no, something very related which IDK) basically some fault in their system coding maybe. who knows? So, basically this is a BUG in SoloLearn code playground, I think so!
23rd Apr 2021, 4:30 PM
RKK
RKK - avatar
+ 3
I tried my best! 😂 That was the perfect example I could ever come! Anyway, it's weird!
23rd Apr 2021, 4:39 PM
RKK
RKK - avatar
+ 2
Rohit That makes sense... except for "/a/b/c" being a file path.😂 Anyways, thanks!
23rd Apr 2021, 4:38 PM
McInventor29
McInventor29 - avatar
+ 2
Running this in Python also outputs "stor../Playground//" print("stor/elec/bio/med/") so this bug is probably affecting output from all types of Sololearn Playground codes. If that is done to prevent us from seeing file paths, that would be ineffective because I printed your string anyway. If it had some secret, you could see the original value anyway. I experimented with the code and commented my findings here: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { string what = "stor/elec/bio/med/";//I type this // The following loop outputs: s t o r / e l e c / b i o / m e d /.. foreach (char c in what) { Console.Write(" " + c); } Console.WriteLine(".."); Console.WriteLine(what);//it outputs stor../Playground// Console.WriteLine("elec/bio/med/");//it outputs elec/bio/med/ Console.WriteLine("/elec/bio/med/");//it outputs ../Playground// Console.WriteLine("/hello/world/hi/");//it outputs ../Playground// Console.WriteLine("stor/elec/bio/med/");//it outputs stor../Playground// Console.WriteLine("stor/" + "elec/bio/med/");//it outputs stor../Playground// Console.Write("stor/"); // it outputs stor Console.Write("elec/bio/med/");//it outputs ../Playground// Console.WriteLine("----"); Console.WriteLine(what.Contains("Playground"));//it denies it's existance Console.WriteLine(what.Contains("bio"));//it still believes the og value is true } } } This discussion is related: https://www.sololearn.com/Discuss/2745141/a-sololearn-bug
25th Apr 2021, 1:04 PM
Josh Greig
Josh Greig - avatar
+ 1
Josh Greig Yeah... this is definitely weird.
25th Apr 2021, 1:16 PM
McInventor29
McInventor29 - avatar