Is there a simple tutorial on how to use these modules? Like, am I supposed to build a function that returns the desired output? A class? None of the above?
If I could just see an example problem solved correctly, that would explain a lot.
I’m confused about how I know if I’ve done anything correctly. I’m on the very first problem BUYPLSE. My understanding of the problem is that I’m supposed to build a function that returns the sum total of the cost of purchased pens and pencils. I’ve tried inputting “2 4 4 5” in the custom input window, I’ve tried putting it at the top of the ide window, and creating an object and running a method that calculates the cost. I can hit “run” but nothing happens. Is there supposed to be a window that shows the console output? I can submit something, but I’m not sure what I’m supposed to be submitting.
def CalculateCost(payload):
list = payload.split(" ")
a = int(list[0])
b = int(list[1])
x = float(list[2])
y = float(list[3])
try:
a <= 1
except Exception:
valueerror("a is not less than or equal to 1")
try:
y <= 10**3
except Exception:
valueerror("y is not less than or equal to 10^3")
output = a*x + b*y
return output
CalculateCost(“2 4 4 5”)