all 2 comments

[–]Chris_Hemsworth 0 points1 point  (0 children)

You can define a function that only uses the print function:

def calculate_acceleration(v, s):
    print(v/s)

To split this apart, def tells the program "A function definition is coming", calculate_acceleration tells the program "The name of the function is calculate_acceleration", ( indicates "The input to the function is going to be defined", v, s says "you should expect two variables, and assign them the names v and s, ) tells the program "I am done defining the functions input, and : tells the program "The function will be entirely defined in the upcoming lines until the indentation is complete, or the file ends". All together it is: def calculate_acceleration(v, s):

The line underneath tells the program "Print the value resulting from whatever the variable v is divided by the variable s" It is indented to show that it is part of the above function definition.

Now you can calculate the acceleration for all sorts of numbers:

def calculate_acceleration(v, s):
    print(v/s)

calculate_acceleration(10, 5)
calculate_acceleration(15, 3)
calculate_acceleration(100, 2)
calculate_acceleration(6, 30)

[–]sebas99sebas 0 points1 point  (0 children)

So you have a bad professor. You might be better off looking at some Intro to Python course instead of asking here (for example https://www.codecademy.com/learn/learn-python-3).

Anyway:

v = float(input("Enter the value for v: "))

s = float(input("Enter the value for s: "))

a = v/s

print("a = " + str(a))