Question: python python code Write a function named foo that has two parameters: n1 and n2. The function returns the outcome of adding up all the
Write a function named foo that has two parameters: n1 and n2. The function returns the outcome of adding up all the numbers above ni up-to but excluding n2, where each number is raised to the power of itself. See below for an example. Your code must check that n1 is less than n2, and if so use a for loop with a range function. Otherwise, return -1. For example, when we pass 1, and 5 to the function it returns the sum of all integers of 22. 33.44 But, if we pass 5 and 1, the outcome is -1. Edit View Insert Format Tools Table 12pt Paragraph BIU 2 Ty 3 I O words >
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
