Im VERY new to programming. Its my second day. In functions like file.read(), empty parenthesis are part of the syntax. Are they always supposed to be empty, or is there an option to fill them? My script works fine, It's just a question I've always had.
2 Answers
It depends whether you what them empty (no arguments ) or not (with arguments)
Here is an example of a function
#Let's create a function that can add two values :) def add(x, y): # the function have positional arguments 'x' 'y' z = x + y return z # the function output the value of z addition = add(5, 33) # call the add() function with arrguments x=5, y=33 print(addition) #this time variables as arguments a = 5 b = 33 additon = add(a ,b) print(addition) As you can see above that function takes input as arguments and returns the output