Working through a Python tutorial. I created a simple script (myFirstFunction) that does not perform whats expected. I expected a line of output that is just two variables multiplied together:
apples = raw_input("How many apples do you have?")
oranges = raw_input("How many oranges do you have?")
def myFirstFunction(apples, oranges):
total_fruit = apples * oranges
print total_fruit
The script does ask for the inputs as expected, but does not print out the results?
myName-MacBook:pythonhard me$ python ex19b.py
How many apples do you have?2
How many oranges do you have?2
myNames-MacBook:pythonhard me$
Why does it not print out 4?
myFirstFunctionanywhere.