Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
def sum3
#1
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.
Reply
#2
remove indentation from line 3
Reply
#3
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 ()
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020