Python Forum
def sum3 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: def sum3 (/thread-26956.html)



def sum3 - NoobPythago - May-19-2020

Hello to the Python community. I am learning Python slowly but surely and currently going through the Udacity cs class that they offer. This code returns no output and was curious as to why that is.
def sum3(a,b,c):
    return a + b + C
    print sum3(3, 2, 4)
Furthermore, I am only using what I have learned to achieve the results. That entails operators, strings, indexing strings. Thank you in advance for any help provided. Also, I wasn't sure how to search the forums for this issue and if someone could guide me on that as well I would appreciate it. This supposed to be the answer to def sum3 that takes 3 inputs and then outputs the total of those inputs.


RE: def sum3 - Larz60+ - May-19-2020

remove indentation from line 3


RE: def sum3 - Yoriz - May-19-2020

Print should not be indented into the function.
you have a little c and a big C they need to match in python
python3 print should use ()