How to make a user defined function that receives parameters such as a list, a string, and an integer

I’m teaching AP CSP and the create task requires the students to define functions that accept arguments. Is it possible to create a function that receives a list and other data types such as strings. I see that I can make a block that has a number and boolean input but I need to define a function that receives a list too.

1 Like

Currently, for the my block, you can only use number or boolean for the function.
However, in VR, you could try to use Switch mode block like the following. So you can define a function in Python with string input or list.

For more information, you could take a look at the following article.

If you want to share a bit more details about the task, I am happy to help you to create a Switch mode program in using functions to accept a list.

1 Like