JPDev@programming.dev to Programmer Humor@programming.dev · 8 months agoExam Answerprogramming.devimagemessage-square127fedilinkarrow-up1422arrow-down16
arrow-up1416arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 8 months agomessage-square127fedilink
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)