I tried running my code but the page comes up blank, I'm a second week programming student and my instructor is confusing the hell out of everybody in my class. Gahhhhh!!!
Here are the exact instructions..
Write a python program that declares a function named distance. The purpose of the function is to calculate the distance between two points and return the result.
The function should define 4 parameter variables. The first 2 parameters declare the x and y coordinates of the first point, and the second 2 parameters declare the x and y coordinates of the second point. The distance function should not prompt for input and it should not do any printing.
Create another function named main that will be responsible for prompting the user for input and calling the distance function. Use exception handling to convert the user input to float. The user input should then be passed as arguments to distance with a function call. Store the return value from the distance function into a variable and then print the results in a pleasing format.
Search the web for information about the distance formula if you have forgotten it. Don't forget to call main!
Here are the exact instructions..
Write a python program that declares a function named distance. The purpose of the function is to calculate the distance between two points and return the result.
The function should define 4 parameter variables. The first 2 parameters declare the x and y coordinates of the first point, and the second 2 parameters declare the x and y coordinates of the second point. The distance function should not prompt for input and it should not do any printing.
Create another function named main that will be responsible for prompting the user for input and calling the distance function. Use exception handling to convert the user input to float. The user input should then be passed as arguments to distance with a function call. Store the return value from the distance function into a variable and then print the results in a pleasing format.
Search the web for information about the distance formula if you have forgotten it. Don't forget to call main!