Python Forum
Thread Rating:
  • 3 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Incorrect code
#12
I found the solution......
def ok(a, b, c):

    if abs(a - b) <= c or a * b >= 0:

        return True

    return False

  

  

def number(d, e):

    f = 0

    for i in range(len(d)-1):

        if not ok(d[i], d[i+1], e):

            f += 1
    return f
Reply


Messages In This Thread
Incorrect code - by janek30 - May-08-2017, 04:07 AM
RE: Incorrect code - by ichabod801 - May-08-2017, 12:09 PM
RE: Incorrect code - by janek30 - May-08-2017, 04:06 PM
RE: Incorrect code - by volcano63 - May-08-2017, 07:44 PM
RE: Incorrect code - by ichabod801 - May-08-2017, 04:19 PM
RE: Incorrect code - by nilamo - May-08-2017, 04:25 PM
RE: Incorrect code - by janek30 - May-08-2017, 04:52 PM
RE: Incorrect code - by nilamo - May-08-2017, 05:24 PM
RE: Incorrect code - by volcano63 - May-08-2017, 07:39 PM
RE: Incorrect code - by nilamo - May-08-2017, 07:43 PM
RE: Incorrect code - by nilamo - May-08-2017, 08:21 PM
RE: Incorrect code - by janek30 - May-09-2017, 10:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I am getting an incorrect average, and not sure why? What's wrong with my code? shirleylam852 8 4,859 Nov-20-2020, 05:32 AM
Last Post: deanhystad
  Return giving incorrect value Calingaladha 5 3,468 Oct-24-2018, 09:53 PM
Last Post: LeSchakal
  Writing incorrect passwords to a file till its correct garth 2 5,023 Feb-10-2017, 11:41 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020