+ 1
Why does this code print 5 and None?
print((print(5)))
2 Réponses
+ 7
5 is printed by the inner print statement.
None is printed by the outer print statement. The None results from the fact that the inner print doesn't return anything (None)
+ 1
5 belongs to inner print so outputs it, then there is nothing in the outer print that results None
inner print sends output to console but not to outer print
try this
print('Outer: ', 10, print('inner: ', 5))