+ 1

Why a null in double print?

In output of print(print(5)), why is there a null? https://code.sololearn.com/cam1vH9u8rpA/?ref=app

26th Oct 2020, 2:55 PM
@viral (◠‿◕)
@viral (◠‿◕) - avatar
2 Answers
+ 3
*None in python not null because print function doesn't return any value, so it will return None The "print(5)" will print 5 but the first "print(...)" prints the returned value of the other one so, its like print(None)
26th Oct 2020, 3:04 PM
Sousou
Sousou - avatar
+ 2
The inner print() returns None - this will be printed by the outer print().
26th Oct 2020, 3:03 PM
Lothar
Lothar - avatar