Add week8 contributions
This commit is contained in:
12
week8/community_contributions/modal_services/get_started.py
Normal file
12
week8/community_contributions/modal_services/get_started.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import sys, modal
|
||||
|
||||
app = modal.App("example-hello-world")
|
||||
|
||||
@app.function()
|
||||
def f(i: int) -> int:
|
||||
if i % 2 == 0:
|
||||
print("hello", i)
|
||||
else:
|
||||
print("world", i, file=sys.stderr)
|
||||
|
||||
return i * i
|
||||
Reference in New Issue
Block a user