Last active
February 25, 2024 12:06
-
-
Save coderodde/4c0f448d6c15e24055e9d732ecbf38a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int, double (ret_int, ret_double) my_foo(a, b, c): | |
if specified a: | |
print "a" | |
if specified b: | |
print "b" | |
if specified c: | |
print "c" | |
if is_requested ret_int: | |
print "int on return requested" | |
if is_requested ret_double: | |
print "double on return requested" | |
return 1, 2.0 | |
_, ret_double = my_foo(1, _, 3): | |
# Returns: | |
# a | |
# c | |
# double on return requested | |
Esim. Olkoon: | |
double, double (r1, r2) GetStatistics(List of ints L): | |
mean = Null | |
if is_requested r1: | |
mean = Mean(L) | |
else | |
return _, _ # No mean, no standard deviation | |
if is_requested r2: | |
return mean, StandardDeviation(L, mean) # Return both mean and standard deviation. | |
return mean, _ # No standard deviation requested. Return only mean. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment