18 lines
311 B
Python
18 lines
311 B
Python
|
import runpod
|
||
|
|
||
|
def is_even(job):
|
||
|
job_input = job["input"]
|
||
|
num = job_input["number"]
|
||
|
|
||
|
if not isinstance(num, int):
|
||
|
return {"error": "Integer required."}
|
||
|
|
||
|
if num % 2 == 0:
|
||
|
return True
|
||
|
|
||
|
return False
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
runpod.serverless.start({"handler": is_even})
|