15.7. ExercisesΒΆ
-
Fill in the parameter list for g so that the invocations of g yield the return values specified
Before you keep reading...
Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.
-
Define a function called
nums
that has three parameters. The first parameter, an integer, should be required. A second parameter namedmult_int
should be optional with a default value of 5. The final parameter,switch
, should also be optional with a default value of False. The function should multiply the two integers together, and if switch is True, should change the sign of the product before returning it.
-
Write a function called
together
that takes three parameters, the first is a required parameter that is a number (integer or float), the second is a required parameter that is a string, and the third is an optional parameter whose default is β β. What is returned is the first parameter, concatenated with the second, using the third.