Contents hide 1) The Python’s nested if…else statement 2) The PHP nested if…else statement 3) The javaScript nested if…else statement In thus tutorial we will see Nested if else Statement In Python PHP and JS Download Python The Python’s nested if…else statement Let’s start with the best language i.e python , As every language have the similar logics but just have a difference in syntax. Building up the nested if..else statement in python if-else.py name = "rehmaanali" age = 12 if age > 10: print ("its true") elif age == 12: print ("Exact") else: print ("its false") Python has dependencies that it should run on a python module Where else in javascript, it builds in a browser. Even the PHP has to be run on the localhost server, as PHP is a server programming. The PHP nested if…else statement PHP is the server programming that should be run on server using localhost server. the code of php is written in php tags i.e <?php /* YOUR CODE GOES HERE*/ ?> Building up the nested if..else statement in php. if-else.php <?php $num = 12; if ($num > "10") { echo "Its true"; } elseif ($num == "12") { echo "Exact!"; } else { echo "its false"; } ?> The following code must be run on localhost server. The javaScript nested if…else statement The javaScript can be run on the local browser it does not depends on the localhost server. it can be run manually. if-else.js var msg = ""; var age = 12; if (age > 10) { msg = "its true"; } else if (time === 20) { msg = "Exact!"; } else { msg = "its false"; } Related Tags: JavaScript, php, python