Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

python
python code
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions