You're viewing a single thread.
The answer is 6. It's 6 characters long.
67 4 ReplyNot really, no. That would be the answer if x= len(day). The code in the image would just throw an error.
22 25 ReplyYea, it's pseudo code.
64 0 Reply"Monday".length is working JavaScript and does equal 6. No print command afaik though.
26 0 ReplyThere technically is!
https://developer.mozilla.org/en-US/docs/Web/API/Window/print
Well. In browsers, anyways.
12 0 ReplyYes, but it prints the page, so in this case it wouldn't print anything
4 0 Reply
function print(str) { console.log(str) }
FTFY
8 1 ReplyYes, but it is JavaScript? Don't you need to terminate the lines with ; to be valid JavaScript? My guess was that this is python code.
1 3 ReplyYou don't need terminating semicolons in JavaScript. They're added in if missing. It can actually cause a few bugs around returns.
2 0 Reply
no it wouldn't, because this is OCR reference language
12 1 ReplyWhat the heck, did someone invent a programming language, so students wouldn't have to learn any real ones?
6 0 ReplyHaving done OCR GCSE computing:
It's just a pseudocode style language that they use in exam questions so that you can understand the question regardless of which language your school had you study (in my case it was VB6 💀). In questions where you are asked to write code, you can use the reference language but realistically you just use the one you learned (although I did it all in python instead)5 0 Reply
Huh interesting. In Scotland we had another one: https://en.wikipedia.org/wiki/Haggis_(programming_language)
1 0 Reply
How do you know what language this is?
1 0 Reply