python code
Write the function definition for a function which accepts one
value from the main program and prints three times the number that
is sent to it.
For example, if the program sent 8, the function would print
24.
Explanation:
Here is the code which has the function three_times taking a value n from the main and then printing 3 times the number n.
Code:
def three_times(n):
print(n*3)
def main():
three_times(8)
main()
Output:
PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!
Get Answers For Free
Most questions answered within 1 hours.