Mar-02-2019, 09:43 PM
I am super to new to this. I'm working on an assignment that is a calculator that uses random method, defines a function, and uses return.
This is not the full code. I've been boiling it down to its smallest parts trying to figure out what I'm doing wrong. This is the part I'm working on right now.
If I replace return with print, everything works fine, including the full code. But using return is part of the assignment.
What am I doing wrong?
Thank you for helping!
This is not the full code. I've been boiling it down to its smallest parts trying to figure out what I'm doing wrong. This is the part I'm working on right now.
If I replace return with print, everything works fine, including the full code. But using return is part of the assignment.
What am I doing wrong?
import random x = random.random()*10 y = random.random()*10 rx = format(x, '.2f') ry = format(y, '.2f') def numbers(x,y): z = rx + ry return z numbers(x,y)This looks exactly like half of the examples I've seen online but theirs work fine and I still can't get anything to return a value
Thank you for helping!