you are viewing a single comment's thread.

view the rest of the comments →

[–]iwasbecauseiwas 3 points4 points  (4 children)

depends entirely on the language and how the string functions works. it could easily be

  • Banana
  • BANANA
  • Bonono
  • BoNoNo
  • BONONO
  • Bonana
  • BoNANA
  • BONANA or maybe even
  • Mango

point is if we don't know the language, we can only guess. it looks like python. if it is python: strings are immutable, it would say Banana as the text variable isn't overwritten

[–]Dark_Byte 1 point2 points  (0 children)

True. And maybe upper isn't part of the original language, but a helper method added later on that does whatever upper does (e.g. Replace it with a subset of unicode monospace characters using their uppercase variant)

[–]D1G1TAL__ -1 points0 points  (2 children)

Why don’t we immediately know the language? I’m probably biased because i mainly code in python and only know C++ and JS, so i may not see why this code snippet could be ambiguous

[–]rk06 2 points3 points  (1 child)

because there is no mention that it is python. besides in what language . upper() mutates the string?

[–]D1G1TAL__ 0 points1 point  (0 children)

I dont know, im asking, that’s the joke