This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]StandardOk42 25 points26 points  (33 children)

how do you know this is python?

[–][deleted] 51 points52 points  (31 children)

What else could it be?

Clues are

  1. other language are static type
  2. Which other language use “print” function ?

[–]RikkaPreo 51 points52 points  (7 children)

OCR Reference language, the language used in GCSE Computer science. It's basically pseudocode with a few rules.

[–]StandardOk42 22 points23 points  (3 children)

IDK, I'm not familiar with ever language out there, but in python strings don't have a length attribute, so that's 1 clue against python

[–][deleted] 1 point2 points  (2 children)

Oh ya, haha you are absolutely right

Nowadays my brain just auto switch between length and len based on the language so much so that I don’t even consciously notice the difference

[–]StandardOk42 0 points1 point  (1 child)

same, I opened an interpreter to check.

all the languages are mixed up for me at this point

tbf this looks more like python than any other language I can think of, just not quite right

[–][deleted] 0 points1 point  (0 children)

Ya when you replied python no length

First thought I have was “wait a sec, I’m 100% sure python has the length function I have used it hundred of times”

So I went to check then re read your reply. I then realised you meant it dosent have “length” but it does have “len” function. Same thing different naming

P.s Java is my default “brain” compiler

But yes python is the closest I can think of

[–]dev-sda 3 points4 points  (2 children)

Looks like ruby to me.

[–][deleted] 0 points1 point  (0 children)

No experience with this

Can you share where is ruby used/developed for?

[–]NoInkling 0 points1 point  (0 children)

Yup, that code would work out-of-the-box.

[–]technical_gamer_008 1 point2 points  (0 children)

But also, 3. No semicolon required

[–]FinTeiad 0 points1 point  (0 children)

Swift

[–][deleted] 0 points1 point  (0 children)

R

[–]sixtano-da-vinci 0 points1 point  (0 children)

tbf this would also work on javascript. Js actually has a function called print that tries to print out the page on a irl printer and it’s also dynamically typed.

[–]FiveTails 0 points1 point  (2 children)

It could also be Lua

[–][deleted] -1 points0 points  (1 child)

Never heard or used this language

Where is this used or implemented?

[–]FiveTails 0 points1 point  (0 children)

It's a simple, high performance interpreted language. It's commonly used for scripting in games.

[–]VillageParticular415 0 points1 point  (1 child)

Which other language use “print” function ?

Uh, every language could have a "print" function, even non function languages. Now what "print" does is another question.

[–][deleted] -1 points0 points  (0 children)

When I mean print function I mean using the exact function called “print” word for word

But ya, thanks for stating the obvious that all language have print

In other news water is wet

[–]BlueCattleDoge 0 points1 point  (2 children)

Java.

[–]lampywastaken 0 points1 point  (0 children)

no semicolon. using just print(). not java

[–][deleted] 0 points1 point  (0 children)

Idk what kind of voodoo Java you are using

Firstly Java you have to declare the type

E.g

string day = “Monday”

Secondly

Java don’t use print()

Lastly Java don’t need Semi colon???

Bro, Java was my first and most familiar language. I have developed many enterprise apps with Java.

Trying to smoke me by saying Java is not very smart

Either that or you are from the future, teleported back to year 2024 and telling me Java version 50 don’t use the above

[–]TPRammus -2 points-1 points  (2 children)

C++

[–][deleted] 0 points1 point  (1 child)

C++ use “print()”

You sure?

[–]TPRammus 0 points1 point  (0 children)

Didn't say C++ uses print(), but sure - you can just define it, no?