Civilloquy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
JPDev@programming.dev to Programmer Humor@programming.dev · 2 年前

Exam Answer

programming.dev

message-square
78
fedilink
649

Exam Answer

programming.dev

JPDev@programming.dev to Programmer Humor@programming.dev · 2 年前
message-square
78
fedilink
  • PhAzE@lemmy.ca
    link
    fedilink
    arrow-up
    60
    arrow-down
    3
    ·
    edit-2
    2 年前

    The answer is 6. It’s 6 characters long.

    • potustheplant@feddit.nl
      link
      fedilink
      arrow-up
      20
      arrow-down
      21
      ·
      2 年前

      Not really, no. That would be the answer if x= len(day). The code in the image would just throw an error.

      • PhAzE@lemmy.ca
        link
        fedilink
        arrow-up
        53
        ·
        2 年前

        Yea, it’s pseudo code.

      • FlumPHP@programming.dev
        link
        fedilink
        arrow-up
        21
        ·
        2 年前

        “Monday”.length is working JavaScript and does equal 6. No print command afaik though.

        • dvlsg@lemmy.world
          link
          fedilink
          English
          arrow-up
          11
          ·
          2 年前

          There technically is!

          https://developer.mozilla.org/en-US/docs/Web/API/Window/print

          Well. In browsers, anyways.

        • PrettyFlyForAFatGuy@feddit.uk
          link
          fedilink
          arrow-up
          6
          arrow-down
          1
          ·
          edit-2
          2 年前
          function print(str) {
            console.log(str)
          }
          

          FTFY

      • force@lemmy.world
        link
        fedilink
        arrow-up
        10
        arrow-down
        1
        ·
        edit-2
        2 年前

        no it wouldn’t, because this is OCR reference language

        run this

        • Ephera@lemmy.ml
          link
          fedilink
          arrow-up
          6
          ·
          2 年前

          What the heck, did someone invent a programming language, so students wouldn’t have to learn any real ones?

          • mounderfod@lemmy.sdf.org
            link
            fedilink
            arrow-up
            4
            ·
            2 年前

            Having 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)

        • 56!@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          2 年前

          Huh interesting. In Scotland we had another one: https://en.wikipedia.org/wiki/Haggis_(programming_language)

      • fidodo@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 年前

        How do you know what language this is?

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 899 users / day
  • 2.61K users / week
  • 7.01K users / month
  • 15K users / 6 months
  • 1 local subscriber
  • 26.9K subscribers
  • 1.59K Posts
  • 40K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org