Mar 24 2024 02:28 PM - edited Mar 24 2024 10:57 PM
I wrote up a pretty detailed account of this here, but Microsoft Loop (the app) is modifying code when pasted into its code blocks, ultimately excluding white spaces in lines before readable characters.
Basic example showing code in original state:
def fizzbuzz(n):
if n % 3 == 0 and n % 5 == 0:
return 'FizzBuzz'
elif n % 3 == 0:
return 'Fizz'
elif n % 5 == 0:
return 'Buzz'
else:
return str(n)
print "\n".join(fizzbuzz(n) for n in xrange(1, 21))
When copying the above code from any app (tried several including Notepad) into Loop, the result is below:
Note the lack of indentation on each return line.
While this is visually undesirable, it's especially problematic for languages like python given its required spacing syntax. If one were to then copy the same code BACK from Loop into a Python program, this code would not work.
Again the article on other board goes into far more depth, but figured it out to be shown here too.
Mar 24 2024 02:45 PM
Mar 24 2024 03:20 PM
Mar 25 2024 06:13 PM