Sep-09-2017, 01:16 PM
The def statement is where the functions are defined. For
age = add(30, 5)
you say it's defined but not called. But it is called. That's how you call the add function: with parameters in parentheses. That causes the add function to print it's message, and the return value is stored in age. Then that age variable is used in the print statement using the results. The % operator for strings allows for inserting values into strings. The first %d in the string is replaced by the first value in the tuple. The 'd' in '%d' indicates the format (digits). Then the second %d is replaced by the second value in the tuple, and so on.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures