Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using python/IDLE to answer the following question: Q.1 Write a function called range_roller[) that takes in two parameters N and K, both as integers. The

using python/IDLE to answer the following question:image text in transcribed

Q.1 Write a function called range_roller[) that takes in two parameters N and K, both as integers. The function should do the following using the range[ ) function: - Return a list of numbers from N to 2N+1 (maximum if possible) with step size =3, if and only if K=0 - Return a list of numbers from N to 0 iminimum if possiblej with step size-2, if and only if K1 - Return 1 if K is neither 0 nor 1 Two examples are shown below: Input: (9,0) Output [9, 12, 15, 18] Input: (11,1) Output: [11,9,7,5,3,1] Q.2 Write a function called while it () that takes in no parameters and returns a list of the series, 105,98,91,....7. Constraint: You have to use a while loop to implement this Input: (984) Output: 21 Input \{21\} Qutput: 3 and the smallest number in the form of a list which is supposed to be arranged in descending order. Two examples are shown below: Input: (100,3,1) Output [100,1] Input: (3,4,4) Output: [4,3]

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions