java and python functions

This assignment has to be done in both python and java. The instructions are For this assignment you will be using functions. You will ask the user to input some numbers. The user can enter 4 numbers. You will then return if the numbers of it forms a rectangle or a square (and if so, what is the perimeter). Remember you must use functions. I will also attach the pdf instructions to this question.