+ 2

why this code will print like hello,none,none,none . And why will it print "hello" befor all "nones"

print(print(print(print("hello"))))

23rd May 2017, 7:25 AM
Paavan Gupta
Paavan Gupta - avatar
3 ответов
+ 3
i think its maths Have u studied BODMAS in maths According to it the problem in the brackets have to be solved first the codes is print(print(print(print("hello")))) As the codes runs before printing the first print it goes to print the one in brackets and going on into brackets it comes to hello and print it and then the one before hello I also don't know but I am comparing it with maths ^-^....
23rd May 2017, 8:13 AM
Rohit
Rohit - avatar
+ 2
thanks to you both
23rd May 2017, 3:44 PM
Paavan Gupta
Paavan Gupta - avatar
+ 1
Hi, it begins by the brackets the most nested so print("hello") in first after print function returns nothing => print(nothing)=none and so on
23rd May 2017, 8:15 AM
MBZH31
MBZH31 - avatar