JPDev@programming.dev to Programmer Humor@programming.dev · 7 months agoExam Answerprogramming.devimagemessage-square129fedilinkarrow-up1798arrow-down111
arrow-up1787arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 7 months agomessage-square129fedilink
minus-squarepaholg@lemm.eelinkfedilinkEnglisharrow-up7·edit-27 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)