-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi,
I tried the following code, attempting to use two types :
@params(bool,float,float)
@rtype(float)
def IfCond(c,a,b):
if c==True :
return a
return b
recevied the following error:
File "twoTypes.py", line 64, in IfCond
if c==True :
TypeError: 'bool' object is not callable
I wanted my function to receive a boolean value (produced by a function with a boolean rtype, for example) and return either a or b, depending upon that value
Could anyone please correct my code, or provide a working example with a boolean-returning function, used by a float-returning function?
Thanks in advance!
Ami
Metadata
Metadata
Assignees
Labels
No labels