New here, I dont get the notation on problems at all.

Hi, I am sure this is an easy question to answer, I am new to this site and only a few months into programming, but I dont get the notation for problems at all.
So for example 'jewels and stones' https://leetcode.com/problems/jewels-and-stones/
in python my solution was:
class Solution:
def numJewelsInStones(self, J: str, S: str):
total=0
for iter in S:
if iter in J:
total +=1
return total

but what I dont get in most of these questions is the def statement is that like ACTUAL CODE or just telling me its a str, followerd by a string? Because I try running that code in my IDE (giving it two strings) and it doesnt run.

Am I over thinking that def statement or what exactly is it telling me?

Comments (2)