O
17

My Python script printed 'None' after every function call and I have no idea why

I wrote a simple function to add two numbers and print the sum, but when I ran it in my terminal, it showed the correct answer followed by 'None' on a new line. I was just following a tutorial from a site called Codecademy. What's causing that extra output and how do I fix it?
3 comments

Log in to join the discussion

Log In
3 Comments
holly_henderson86
Did you print the function itself?
5
eva_ross
eva_ross6d ago
My friend had that happen when they forgot the return statement.
1
robin_lee
robin_lee6d ago
Yeah, seen that too... @eva_ross, classic mistake.
2