Jump in the discussion.

No email address required.


from PythonInterface import Python
from PythonObject import PythonObject
from IO import print
from Range import range

def main() -> None:
   let dictionary = Python.dict()
   dictionary["fruit"] = "apple"
   dictionary["starch"] = "potato"
   let keys: PythonObject = ["fruit", "starch", "protein"]
   let N: Int = keys.__len__().to_index()
   print(N, "items")
   for i in range(N):
       if Python.is_type(dictionary.get(keys[i]), Python.none()):
           print(keys[i], "is not in dictionary")
       else:
           print(keys[i], "is included")

What the fuck is this :marseypuke:

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.