Dec-13-2019, 05:24 PM
Your indentation is way off
When you define a function all of the code in that function must be indented. The first line that unindents ends the function's block of code. Is all of this code supposed to be in your function?
You also missed the requirement of collecting the variables and passing them into the function as parameters.
Here is an example of a function that takes a parameter:
When you define a function all of the code in that function must be indented. The first line that unindents ends the function's block of code. Is all of this code supposed to be in your function?
You also missed the requirement of collecting the variables and passing them into the function as parameters.
Here is an example of a function that takes a parameter:
def plus_one(num_input): # Parameters go in parentheses incremented = num_input + 1 # Any other code for this function must be indented like this # As ichabod801 said it must all come before the return statement as well return incremented # Since this code is not indented it is not part of the function age = int(input("What is your age: ")) # Collect your variable next_years_age = plus_one(age) # Send variable into the function and store the result print("our age next year will be", next_years_age) # Use the result produced by the functionTry again and post your results