-2

Trying to understand why this is happening. When I put tall() inside print(), it prints tall() but ALSO a None value. Why is the value None given after it has already printed out tall()?

def tall():
    print('31337')
print(tall())

Result:

31337
None
Qvanta
  • 1
  • Because tall() doesn't return anything. – Red Cricket Apr 20 '20 at 05:30
  • In `print(2 + 2)`, `2 + 2` has a value. Which value do you think `tall()` has? Compare what you know about the expression `tall()` to other expressions, and try some things out in the REPL. – Ry- Apr 20 '20 at 05:30
  • The return type of your function tall() is None. That's why it is printing the output like this. – Dhaval Taunk Apr 20 '20 at 05:30

1 Answers1

0

You must know that a function always return a value and in your case your function is not returning any value so the None value also.