Posts

Showing posts with the label python Interview Questions and Answers

palindrome in python3.6 and php7

I am just practising, some interview question in both python and php to solve palindrome in easy way  to remember in interview.please share your solution or any latest interview question both php and python in comment box. PHP : $s =  'malayalam' ; $y =  '' ; for  ($i = strlen($s) -  1 ; $i >=  0 ; $i--) {     $y .= $s[$i]; } echo $y .  '</br>' ; if  ($s == $y) {     echo  "true" ; }  else  {     echo  "false" ; }