Jump to content

Python help

Hyperthread1

Im new at python and i have been given this question to answer and i still have no clue what it means. can someone help me anser this or make the code for it? That would be great!

 

Write a program that contains a function called mystery that takes two arguments, x and y, and returns x // y.  Call the function with several pairs of integers; both positive, both negative, one positive and one negative.  Note the results of the python // operator on integers.   Next call the mystery function with pairs of float values.  Note the results  of the python // operator on floatsDesign the program and show your design to me before you begin coding.  Remember to incorporate what you have learned thus far; lists, functions, parameters, etc.

Link to comment
Share on other sites

Link to post
Share on other sites

def mystery(x,y):    return x // yprint(mystery(5,9))print(mystery(1.044,6.49))
 

Im new at python and i have been given this question to answer and i still have no clue what it means. can someone help me anser this or make the code for it? That would be great!

 

Write a program that contains a function called mystery that takes two arguments, x and y, and returns x // y.  Call the function with several pairs of integers; both positive, both negative, one positive and one negative.  Note the results of the python // operator on integers.   Next call the mystery function with pairs of float values.  Note the results  of the python // operator on floats.  Design the program and show your design to me before you begin coding.  Remember to incorporate what you have learned thus far; lists, functions, parameters, etc.

 
That's the jist of it, change the integers at the end as necessary.
I.e. print(mystery(-5,-9))
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×