Question

PYTHON please help! im stuck on this homework question, THANK YOU! please follow the rules!Give a recursive python implementation of the following function: def check_Decreasing_Order(lissy): Given lissy, a python li

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code and output

for main.py 1- def check_Decreasing order(lissy): 2 k=len(lissy) 3 if k in [0,1]: 4 return True 5 if lissy[@]>=lissy[1]: 6 re

Code for copying(checkindentation)

def check_Decreasing_order(lissy):
k=len(lissy)
if k in [0,1]:
return True
if lissy[0]>=lissy[1]:
return check_Decreasing_order(lissy[1:])
return False
lissy=list(map(int,input().rstrip().split()))
print(check_Decreasing_order(lissy))

Add a comment
Know the answer?
Add Answer to:
PYTHON please help! im stuck on this homework question, THANK YOU! please follow the rules! Give...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PYTHON this implementation is really hard, Im stuck especially with the requirements they give. PLEASE HELP!...

    PYTHON this implementation is really hard, Im stuck especially with the requirements they give. PLEASE HELP! THANK YOU! RECURSIVE! Give a recursive python implementation of the following function: def check_Decreasing_Order(lissy): Given lissy, a python list of integers, the above function will return True if lissy is sorted in decreasing order, otherwise it will return false. For example, print(check_Decreasing Order([100,50,8, -2])) True print(check_Decreasing_Order([108,50,8,2,35])) False Implementation Requirements: 1. Your implementation must be recursive. 2. If you need more parameters, you may define...

  • PYTHON I need help with this Python problem, please follow all the rules! Please help! THANK...

    PYTHON I need help with this Python problem, please follow all the rules! Please help! THANK YOU! Bonus Question Implement an efficient algorithm (Python code) for finding the 11th largest element in a list of size n. Assume that n will be greater than 11. det find 11th largest numberlissy Given, lissy, a list of n integers, the above function will return the 11th largest integer from lissy You can assume that length of lissy will be greater than 11....

  • PYTHON Stuck with this problem with these implementation requirements. PLEASE HELP! THANK YOU! PYTHON Q7 16...

    PYTHON Stuck with this problem with these implementation requirements. PLEASE HELP! THANK YOU! PYTHON Q7 16 Points Give a python implementation of the following function: def without_Vowels(listi): The above function gets a list of positive integers and English letters, list1. When called, it should remove all the vowels from list1, and keep only the consonants and integers. The Order of the remaining consonants and integers does not matter. For example, if list1 = ['a', 'b', 5, 'c', 'o', 2, 'e',...

  • PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU!...

    PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU! Implement an efficient python function for the following: def find_Number_of_A11_Possible_Ways(matrix, totalGasAmount): The above function will count all the possible paths from top left cell to bottom right cell of a matrix using exactly totalGasAmount. Each cell of this matrix has a nonnegative number which represents gas amount of that cell. The constraint is that from each cell, you can either move right or move...

  • python 2..fundamentals of python 1.Package Newton’s method for approximating square roots (Case Study 3.6) in a...

    python 2..fundamentals of python 1.Package Newton’s method for approximating square roots (Case Study 3.6) in a function named newton. This function expects the input number as an argument and returns the estimate of its square root. The script should also include a main function that allows the user to compute square roots of inputs until she presses the enter/return key. 2.Convert Newton’s method for approximating square roots in Project 1 to a recursive function named newton. (Hint: The estimate of...

  • Hi, I have programming problem related to array, sorting, and. swap operation Thank you, Best Regards.....

    Hi, I have programming problem related to array, sorting, and. swap operation Thank you, Best Regards.. A non-empty array A consisting of N integers is given. You can perform a single swap operation in array A. This operation takes two indices I and J, such that 0 S13 J<N, and exchanges the values of A[i] and A[J]. The goal is to check whether array A can be sorted into non-decreasing order by performing at most one swap operation. For example,...

  • Requirements Write functions isMemberR, a recursive function, and isMemberI, which will use an iterative approach, to...

    Requirements Write functions isMemberR, a recursive function, and isMemberI, which will use an iterative approach, to implement a binary search algorithm to determine whether a given element is a member of a given sequence Each function will have two parameters, aseq, a sorted sequence, and target. isMemberR and isMemberI will return True if target is an element of the sequence, and False otherwise. Your implementations must implement the binary search algorithm described above. When function i sMemberR recursively invokes itself,...

  • Please help on my homework Q i got wrong: PYTHON Question 1 def higherOrderFilter(data, p) :...

    Please help on my homework Q i got wrong: PYTHON Question 1 def higherOrderFilter(data, p) :     res = []     for d in data :         if p(d) :             res.append(d)     return res def FilterR(data, p):     if data == []:         return []     return [data[0]] + FilterR(data[1:], p) if p(data[0]) else FilterR(data[1:], p) Both of these functions produce the same output given the same data and same filtering condition p. True False    Question 2...

  • Must be in Python 3 exercise_2.py # Define the Student class class Student():    # Ini...

    Must be in Python 3 exercise_2.py # Define the Student class class Student():    # Initialize the object properties def __init__(self, id, name, mark): # TODO # Print the object as an string def __str__(self): return ' - {}, {}, {}'.format(self.id, self.name, self.mark) # Check if the mark of the input student is greater than the student object # The output is either True or False def is_greater_than(self, another_student): # TODO # Sort the student_list # The output is the sorted...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT