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

Exam Answer

programming.dev

message-square
78
fedilink
649

Exam Answer

programming.dev

JPDev@programming.dev to Programmer Humor@programming.dev · 2 years ago
message-square
78
fedilink
  • stoly@lemmy.world
    link
    fedilink
    arrow-up
    17
    arrow-down
    9
    ·
    2 years ago

    I wonder if day length is given separately in a table prior to the question? I’m not sure what they wanted except maybe seconds?

    • Akrenion@programming.dev
      link
      fedilink
      arrow-up
      85
      ·
      2 years ago

      It’s the length of the string. The number of characters is 6. It’s a play on words and a question.

      • stoly@lemmy.world
        link
        fedilink
        arrow-up
        12
        ·
        2 years ago

        Oh wow. Thanks

    • Car@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      20
      ·
      2 years ago

      I’m assuming they wanted the literal length of the string

      • stoly@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        2 years ago

        That seems to be the consensus.

      • zarkanian@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Naw, they wanted the metaphorical length. Computers are great at metaphors.

    • CrazyEddie041@kbin.social
      link
      fedilink
      arrow-up
      11
      ·
      2 years ago

      Conversations about language aside, the error is that “Monday” is a string with a length of 6.

      • nathanjent@programming.dev
        link
        fedilink
        arrow-up
        4
        arrow-down
        2
        ·
        2 years ago

        What is the type of the variable day though? As it is we have to make multiple assumptions, based on popular programming languages, about the internals of the string type and the print function to assume that it prints “6”.

        • ripcord@lemmy.world
          link
          fedilink
          arrow-up
          6
          ·
          2 years ago

          There is a fairly good chance that there has been more info presented in the class than we have been given here.

        • Aatube@kbin.social
          link
          fedilink
          arrow-up
          2
          ·
          2 years ago

          deleted by creator

        • morrowind@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          That’s the variable name, not the type

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.

  • 329 users / day
  • 2.66K users / week
  • 6.95K users / month
  • 15K users / 6 months
  • 1 local subscriber
  • 26.9K subscribers
  • 1.59K Posts
  • 39.9K 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