About 7,200,000 results
Open links in new tab
  1. python - Why is this printing 'None' in the output? - Stack Overflow

    Mar 2, 2015 · Because there are two print statements. First is inside function and second is outside function. When a function doesn't return anything, it implicitly returns None. Use return …

  2. python - Why is "None" printed after my function's output

    It's the return value of the function, which you print out. If there is no return statement (or just a return without an argument), an implicit return None is added to the end of a function. You …

  3. Why does my function print None in Python [Solved] - bobbyhadz

    Apr 8, 2024 · Functions often print None when we pass the result of calling a function that doesn't return anything to the print() function. All functions that don't explicitly return a value, return …

  4. "None" keeps showing up when I run my program - Stack Overflow

    May 27, 2013 · Whenever I run the calculator program I created, it works fine but the text "None" keeps showing up and I don't know why. Here's the code: def add(): print 'choose 2 numbers …

  5. Why Your Python Function Prints None (and How to Fix It)

    Seeing None printed unexpectedly when you call a Python function is a common source of confusion, especially for beginners. This guide explains the fundamental reasons why a …

  6. Why Python Functions Print None and How to Avoid it

    In summary, Python functions print None when they don’t explicitly return a value or when the return statement does not specify a value. None values can also come from variables and built …

  7. Why is ‘None’ printed after my function’s output in Python 3?

    Dec 26, 2024 · In Python 3, “None” is printed after a function’s output when the function either does not explicitly return a value or explicitly returns “None”. It is important to ensure that …

  8. How to remove "None" from output - Discussions on Python.org

    Aug 14, 2022 · The None is passed to the print on that last line and is printed. Alternatives: Don’t print the search on the last line, just call search (with no print surrounding).

  9. Why is it printing "None"? - Python Forum

    Feb 8, 2021 · If you make a function without any return statement inside, the object None is returned implicit. For example print was in Python 2 a statement. Now since long time, print is …

  10. python - getting 'none' at the end of printing a list

    Sep 13, 2016 · When you write print(share_details(share_data)) - it means print the value returned by share_details function. The function returns None after printing the values. If the …

Refresh