JPDev@programming.dev to Programmer Humor@programming.dev · 9 months agoExam Answerprogramming.devimagemessage-square129fedilinkarrow-up1799arrow-down111
arrow-up1788arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 9 months agomessage-square129fedilink
minus-squarepaholg@lemm.eelinkfedilinkEnglisharrow-up7·edit-29 months agoIt could be Ruby; puts is more common, but there is a print. With some silly context, the answer could even be correct: #!/usr/bin/env ruby module DayLength def length if ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].include? self "24 hours" else super end end end class String prepend DayLength end day = "Monday" x = day.length print(x)
It could be Ruby;
puts
is more common, but there is aprint
. With some silly context, the answer could even be correct:#!/usr/bin/env ruby module DayLength def length if ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].include? self "24 hours" else super end end end class String prepend DayLength end day = "Monday" x = day.length print(x)