## KY_Fan

I have tried to figure this out on my own forever now. I have been getting hint from the net but can't figure it out. So I figured I would admit defeat and see what you guys could show me. I need the three numbers entered into this program to add together, as of right now they aren't adding. The numbers are just showing up. EDIT: I AM A NOOB AT PROGRAMMING

``````def main():

a = input("Please select a number:")
b = input("And another one:")
d = a+b+c
print(d)

main()
``````

## pyTony 888

Which numbers? I only see you taking three string input and then concatenating them, assuming you are using python3 as indicated by form of your print statements. No use to define a function for only one print call.

## KY_Fan

I have to input a random number each time it asks (After I run the code). Then instead of giving me the sum of the three random numbers I put in, it just displays the three random numbers. Where I am knew to this stuff it is kind of difficult for me to explain and my professor is a loser and won't help!! lol

## pyTony 888

``````def add():
a = input("Please select a number: ")
b = input("And another one: ")
c = input("One more please: ")
return float(a) + float(b) + float(c)

``````

## KY_Fan

Wooo! Thanks for showing me the proper code. I just can't believe I took this online CS course and professor is horrible. He doesn't help at ALL and he only gives us a day or so per assignment. Considering this is an intro to CS class you would think we would have more time! I am going to try and reconnect with one of my high school teachers that knows how to code.

## sneekula 969

This is really a question of what version of Python you are using.
If you use Python2 then input() is for numeric input, but with Python3 you will get strings.

With Python27 this will work:

``````# Python27

def main():
a = input("Please select a number:")
b = input("And another one:")
d = a+b+c
print(d)

main()

'''possible result ...

And another one:2
6

'''
``````

## KY_Fan

Well I am using Python3. I guess that is why I was having so much trouble, I'm not sure what my version of Python my book is using either. I guess I need to read up some more..

Thanks for the help!

## sneekula 969

``````# find the version of Python you are using

import platform

print(platform.python_version())
``````