Search This Blog

Wednesday, 1 March 2017

(R language) Multiple line code in list

multireturn <- function(x,y)
{
  mylist <- list("name" = name <- readline(prompt = "Enter Name"), x+y, if((x+y)%%2==0){print("Even")}else {print("odd")}  )
  return(mylist)
}
multireturn(2,3)