JPDev@programming.dev to Programmer Humor@programming.dev · 8 months agoExam Answerprogramming.devimagemessage-square125fedilinkarrow-up1783arrow-down111
arrow-up1772arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 8 months agomessage-square125fedilink
minus-squarepaholg@lemm.eelinkfedilinkEnglisharrow-up7·edit-28 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)